physfs_byteorder.c
changeset 629 b01a59827192
parent 578 bff1af8455ca
child 654 c0ae01de361d
equal deleted inserted replaced
628:f6b7d7beec8a 629:b01a59827192
    15 #include <stdio.h>
    15 #include <stdio.h>
    16 #include <stdlib.h>
    16 #include <stdlib.h>
    17 
    17 
    18 #define __PHYSICSFS_INTERNAL__
    18 #define __PHYSICSFS_INTERNAL__
    19 #include "physfs_internal.h"
    19 #include "physfs_internal.h"
    20 
       
    21 /* This byteorder stuff was lifted from SDL. http://www.libsdl.org/ */
       
    22 #define PHYSFS_LIL_ENDIAN  1234
       
    23 #define PHYSFS_BIG_ENDIAN  4321
       
    24 
       
    25 #if  defined(__i386__) || defined(__ia64__) || defined(WIN32) || \
       
    26     (defined(__alpha__) || defined(__alpha)) || \
       
    27      defined(__arm__) || defined(ARM) || \
       
    28     (defined(__mips__) && defined(__MIPSEL__)) || \
       
    29      defined(__SYMBIAN32__) || \
       
    30      defined(__x86_64__) || \
       
    31      defined(__LITTLE_ENDIAN__)
       
    32 #define PHYSFS_BYTEORDER    PHYSFS_LIL_ENDIAN
       
    33 #else
       
    34 #define PHYSFS_BYTEORDER    PHYSFS_BIG_ENDIAN
       
    35 #endif
       
    36 
       
    37 
    20 
    38 /* The macros used to swap values */
    21 /* The macros used to swap values */
    39 /* Try to use superfast macros on systems that support them */
    22 /* Try to use superfast macros on systems that support them */
    40 #ifdef linux
    23 #ifdef linux
    41 #include <asm/byteorder.h>
    24 #include <asm/byteorder.h>