|
Size: 1842
Comment: update formatting
|
Size: 1842
Comment: update formatting
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 9: | Line 9: |
| '''Primary Include:''' [[http://hg.libsdl.org/SDL/file/68dfd6df47da/include/SDL_endian.h|SDL_endian.h]] | '''Include File(s):''' [[http://hg.libsdl.org/SDL/file/68dfd6df47da/include/SDL_endian.h|SDL_endian.h]] |
DRAFT |
Byte Order and Byte Swapping
Include File(s): SDL_endian.h
Introduction
This category contains functions for reading and writing endian-specific values.
Endianness comes in two forms - big and little.
- SDL_LIL_ENDIAN means byte order is 1234, where the smaller (little) numbered position comes first
- SDL_BIG_ENDIAN means byte order is 4321, where the larger (big) numbered position comes first
green
This header uses inline functions for compilers that support them, and static functions for those that do not. Because these functions become static for compilers that do not support inline functions, this header should only be included in files that actually use them.
green
#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
#if defined(__hppa__) || \
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
(defined(__MIPS__) && defined(__MISPEB__)) || \
defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
defined(__sparc__)
#define SDL_BYTEORDER SDL_BIG_ENDIAN
#else
#define SDL_BYTEORDER SDL_LIL_ENDIAN
#endif
#endif /* !SDL_BYTEORDER */
