Ticket #50288: patch-driver_rtcm2.c.diff

File patch-driver_rtcm2.c.diff, 1.3 KB (added by fhgwright (Fred Wright), 9 years ago)

Patch for endianness check on 10.5 (and earlier)

  • driver_rtcm2.c

    old new  
    8888#endif
    8989
    9090/*
    91  * BSD uses _BYTE_ORDER, and Linux uses __BYTE_ORDER.
    92  */
    93 #if !defined( __BYTE_ORDER) && defined(_BYTE_ORDER)
    94 #define __BYTE_ORDER _BYTE_ORDER
    95 #endif
    96 #if !defined( __BIG_ENDIAN) && defined(_BIG_ENDIAN)
    97 #define __BIG_ENDIAN _BIG_ENDIAN
    98 #endif
    99 #if !defined( __LITTLE_ENDIAN) && defined(_LITTLE_ENDIAN)
    100 #define __LITTLE_ENDIAN _LITTLE_ENDIAN
    101 #endif
    102 
    103 /*
    10491 * Darwin (Mac OS X) uses special defines.
     92 * This must precede the BSD case, since _BIG_ENDIAN may be incorrectly defined
    10593 */
    10694#if !defined( __BYTE_ORDER) && defined(__DARWIN_BYTE_ORDER)
    10795#define __BYTE_ORDER __DARWIN_BYTE_ORDER
     
    113101#define __LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN
    114102#endif
    115103
     104/*
     105 * BSD uses _BYTE_ORDER, and Linux uses __BYTE_ORDER.
     106 */
     107#if !defined( __BYTE_ORDER) && defined(_BYTE_ORDER)
     108#define __BYTE_ORDER _BYTE_ORDER
     109#endif
     110#if !defined( __BIG_ENDIAN) && defined(_BIG_ENDIAN)
     111#define __BIG_ENDIAN _BIG_ENDIAN
     112#endif
     113#if !defined( __LITTLE_ENDIAN) && defined(_LITTLE_ENDIAN)
     114#define __LITTLE_ENDIAN _LITTLE_ENDIAN
     115#endif
     116
    116117#if !defined(__BYTE_ORDER) || !defined(__BIG_ENDIAN) || !defined(__LITTLE_ENDIAN)
    117118#error endianness macros are not defined
    118119#endif