Skip to content

Commit 652eaa6

Browse files
committed
compat BUGFIX avoid macro collision
1 parent 9e7be59 commit 652eaa6

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

CMakeModules/UseCompat.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ macro(USE_COMPAT)
1717
check_symbol_exists(strndup "string.h" HAVE_STRNDUP)
1818
check_symbol_exists(getline "stdio.h" HAVE_GETLINE)
1919

20-
TEST_BIG_ENDIAN(BIG_ENDIAN)
20+
TEST_BIG_ENDIAN(IS_BIG_ENDIAN)
2121

2222
# header and object file
2323
configure_file(${PROJECT_SOURCE_DIR}/compat/compat.h.in ${PROJECT_BINARY_DIR}/compat.h @ONLY)

compat/compat.h.in

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@
5353
#undef le64toh
5454
#undef htole64
5555

56-
#cmakedefine BIG_ENDIAN
56+
#cmakedefine IS_BIG_ENDIAN
5757

58-
#ifdef BIG_ENDIAN
59-
# define le64toh(x) (x)
60-
# define htole64(x) (x)
61-
#else
58+
#ifdef IS_BIG_ENDIAN
6259
# define le64toh(x) bswap64(x)
6360
# define htole64(x) bswap64(x)
61+
#else
62+
# define le64toh(x) (x)
63+
# define htole64(x) (x)
6464
#endif
6565

6666
#ifndef MAP_ANONYMOUS

0 commit comments

Comments
 (0)