Skip to content

Commit 839fa9c

Browse files
committed
compat/bswap.h: restore preference __BIG_ENDIAN over BIG_ENDIAN
The previous commit swaps the order we check the macros defined by the compiler and the system headers from the original. Since the order of check should not matter (i.e. it is insane to define both __BIG_ENDIAN and friends and BIG_ENDIAN and friends and in a conflicting way), it is the most conservative thing to do not to change it. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3cf6bb3 commit 839fa9c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

compat/bswap.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,18 @@ static inline uint64_t git_bswap64(uint64_t x)
101101
#undef ntohll
102102
#undef htonll
103103

104-
#if defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN)
105-
106-
# define GIT_BYTE_ORDER BYTE_ORDER
107-
# define GIT_LITTLE_ENDIAN LITTLE_ENDIAN
108-
# define GIT_BIG_ENDIAN BIG_ENDIAN
109-
110-
#elif defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN)
104+
#if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN)
111105

112106
# define GIT_BYTE_ORDER __BYTE_ORDER
113107
# define GIT_LITTLE_ENDIAN __LITTLE_ENDIAN
114108
# define GIT_BIG_ENDIAN __BIG_ENDIAN
115109

110+
#elif defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN)
111+
112+
# define GIT_BYTE_ORDER BYTE_ORDER
113+
# define GIT_LITTLE_ENDIAN LITTLE_ENDIAN
114+
# define GIT_BIG_ENDIAN BIG_ENDIAN
115+
116116
#else
117117

118118
# define GIT_BIG_ENDIAN 4321

0 commit comments

Comments
 (0)