Skip to content

Commit

Permalink
Resolve xTEA endianness issues on Linux
Browse files Browse the repository at this point in the history
The cstdlib header includes endian.h on Linux, which defines BIG_ENDIAN
(and LITTLE_ENDIAN) unconditionally, so we need to use a more unique
name for our project-level define.

Closes #11.
  • Loading branch information
dpogue committed Jul 27, 2024
1 parent a1c064f commit 831575d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmodule/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ else()
test_big_endian(BIG_ENDIAN)
endif()
if(BIG_ENDIAN)
target_compile_definitions(urumanifest PRIVATE BIG_ENDIAN)
target_compile_definitions(urumanifest PRIVATE URUMANIFEST_BIG_ENDIAN)
endif()
2 changes: 1 addition & 1 deletion cmodule/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace

inline uint32_t swap_le(uint32_t value)
{
#ifdef BIG_ENDIAN
#ifdef URUMANIFEST_BIG_ENDIAN
value = byteswap(value);
#endif
return value;
Expand Down

0 comments on commit 831575d

Please sign in to comment.