Skip to content

Commit

Permalink
compat/bswap.h: restore preference __BIG_ENDIAN over BIG_ENDIAN
Browse files Browse the repository at this point in the history
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 <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed May 2, 2014
1 parent 3cf6bb3 commit 839fa9c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions compat/bswap.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,18 @@ static inline uint64_t git_bswap64(uint64_t x)
#undef ntohll
#undef htonll

#if defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN)

# define GIT_BYTE_ORDER BYTE_ORDER
# define GIT_LITTLE_ENDIAN LITTLE_ENDIAN
# define GIT_BIG_ENDIAN BIG_ENDIAN

#elif defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN)
#if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN)

# define GIT_BYTE_ORDER __BYTE_ORDER
# define GIT_LITTLE_ENDIAN __LITTLE_ENDIAN
# define GIT_BIG_ENDIAN __BIG_ENDIAN

#elif defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN)

# define GIT_BYTE_ORDER BYTE_ORDER
# define GIT_LITTLE_ENDIAN LITTLE_ENDIAN
# define GIT_BIG_ENDIAN BIG_ENDIAN

#else

# define GIT_BIG_ENDIAN 4321
Expand Down

0 comments on commit 839fa9c

Please sign in to comment.