mirror of
https://git.code.sf.net/p/ntfs-3g/ntfs-3g.git
synced 2024-11-23 18:14:24 +08:00
endians.h: Fix bad assumption of valid __BYTE_ORDER__ values.
On the OpenIndiana Hipster distribution, compiling with GCC 4.9 would fail because __BYTE_ORDER__ was defined but not to any of the values assumed to be associated with this define (__LITTLE_ENDIAN__ or __BIG_ENDIAN__). Instead it was defined to either __ORDER_LITTLE_ENDIAN__ or __ORDER_BIG_ENDIAN__. This caused compilation to fail. Fixed by checking that all referenced defines are in fact defined before using them and adding an additional #elif clause for this newly discovered condition.
This commit is contained in:
parent
9dee659190
commit
9d1360b282
@ -61,10 +61,16 @@
|
||||
# define __BYTE_ORDER BYTE_ORDER
|
||||
# define __LITTLE_ENDIAN LITTLE_ENDIAN
|
||||
# define __BIG_ENDIAN BIG_ENDIAN
|
||||
# elif defined(__BYTE_ORDER__)
|
||||
# elif defined(__BYTE_ORDER__) && defined(__LITTLE_ENDIAN__) && \
|
||||
defined(__BIG_ENDIAN__)
|
||||
# define __BYTE_ORDER __BYTE_ORDER__
|
||||
# define __LITTLE_ENDIAN __LITTLE_ENDIAN__
|
||||
# define __BIG_ENDIAN __BIG_ENDIAN__
|
||||
# elif defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \
|
||||
defined(__ORDER_BIG_ENDIAN__)
|
||||
# define __BYTE_ORDER __BYTE_ORDER__
|
||||
# define __LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__
|
||||
# define __BIG_ENDIAN __ORDER_BIG_ENDIAN__
|
||||
# elif (defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)) || \
|
||||
defined(WORDS_LITTLEENDIAN)
|
||||
# define __BYTE_ORDER 1
|
||||
|
Loading…
Reference in New Issue
Block a user