include/SDL_endian.h
changeset 1368 533567cbb576
parent 1354 22f39393668a
child 1369 42eeb14770e3
equal deleted inserted replaced
1367:e440d5c488c1 1368:533567cbb576
    50 /* Set up for C function definitions, even when using C++ */
    50 /* Set up for C function definitions, even when using C++ */
    51 #ifdef __cplusplus
    51 #ifdef __cplusplus
    52 extern "C" {
    52 extern "C" {
    53 #endif
    53 #endif
    54 
    54 
    55 /* Use inline functions for compilers that support them, and static
    55 /* Use __inline__ functions for compilers that support them, and static
    56    functions for those that do not.  Because these functions become
    56    functions for those that do not.  Because these functions become
    57    static for compilers that do not support inline functions, this
    57    static for compilers that do not support __inline__ functions, this
    58    header should only be included in files that actually use them.
    58    header should only be included in files that actually use them.
    59 */
    59 */
    60 #if defined(__GNUC__) && defined(__i386__)
    60 #if defined(__GNUC__) && defined(__i386__) &&
       
    61    !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */)
    61 static __inline__ Uint16 SDL_Swap16(Uint16 x)
    62 static __inline__ Uint16 SDL_Swap16(Uint16 x)
    62 {
    63 {
    63 	__asm__("xchgb %b0,%h0" : "=q" (x) :  "0" (x));
    64 	__asm__("xchgb %b0,%h0" : "=q" (x) :  "0" (x));
    64 	return x;
    65 	return x;
    65 }
    66 }