WORDS_BIGENDIAN needs to be a compile definition and checked with ifdef.

pull/2168/head
John Ralls 1 month ago
parent b028f50fa3
commit 622c35cfaa

@ -799,7 +799,7 @@ check_include_files (wctype.h HAVE_WCTYPE_H)
test_big_endian(IS_BIGENDIAN)
if (IS_BIGENDIAN)
set(WORDS_BIGENDIAN)
add_compile_definition (WORDS_BIGENDIAN)
endif()
if (NOT DISABLE_NLS)

@ -49,7 +49,7 @@ template<typename T>
T*
endian_swap(T* t)
{
#if ! WORDS_BIGENDIAN
#ifndef WORDS_BIGENDIAN
auto memp = reinterpret_cast<unsigned char*>(t);
std::reverse(memp, memp + sizeof(T));
#endif

Loading…
Cancel
Save