Skip to content

Commit 6b111a3

Browse files
committed
Handle the msgpack endianness
1 parent b20e71b commit 6b111a3

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

CMakeLists.txt

+7-7
Original file line numberDiff line numberDiff line change
@@ -257,13 +257,13 @@ list(APPEND APP_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/externals/fmtlib"
257257
list(APPEND APP_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include")
258258
list(APPEND APP_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
259259

260-
# Set endianess for msgpack on ARM64 with MSVC
261-
if(MSVC)
262-
if("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "ARM64")
263-
message(STATUS "Forcing msgpack-c to use little endian configuration")
264-
add_compile_definitions(MSGPACK_ENDIAN_LITTLE_BYTE)
265-
endif()
266-
endif()
260+
## Set endianess for msgpack on ARM64 with MSVC
261+
#if(MSVC)
262+
# if("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "ARM64")
263+
# message(STATUS "Forcing msgpack-c to use little endian configuration")
264+
# add_compile_definitions(MSGPACK_ENDIAN_LITTLE_BYTE)
265+
# endif()
266+
#endif()
267267

268268
include_directories(${APP_INCLUDE_DIRS})
269269

include/CPmsgpack.h

+9
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,17 @@
44
# pragma warning(disable : 4267)
55
#endif
66

7+
// Workaround MSVC endiannes issues
8+
#if defined(_MSC_VER) && ( defined(_M_ARM) || defined(_M_ARM64) )
9+
# define MSGPACK_ENDIAN_LITTLE_BYTE
10+
#endif
11+
712
#include "msgpack.hpp"
813

14+
#if defined(MSGPACK_ENDIAN_LITTLE_BYTE)
15+
# undef MSGPACK_ENDIAN_LITTLE_BYTE
16+
#endif
17+
918
#ifdef _MSC_VER
1019
# pragma warning(pop)
1120
#endif

0 commit comments

Comments
 (0)