Skip to content

Commit 7bcb6aa

Browse files
committed
fix detection of linux based os. According to https://sourceforge.net/p/predef/wiki/OperatingSystems/ 'linux' macro is obsolete, '__linux__' should be used instead. It turns out that 'linux' macro undefined when compiling project with e.g. '-std=c++11' compilation flag
1 parent 63511f2 commit 7bcb6aa

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/msgpack/predef/os/linux.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Distributed under the Boost Software License, Version 1.0.
2727
#define MSGPACK_OS_LINUX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
2828

2929
#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
30-
defined(linux) || defined(__linux) \
30+
defined(linux) || defined(__linux) || defined(__linux__) \
3131
)
3232
# undef MSGPACK_OS_LINUX
3333
# define MSGPACK_OS_LINUX MSGPACK_VERSION_NUMBER_AVAILABLE

include/msgpack/sysdep.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
#elif defined(unix) || defined(__unix) || defined(__APPLE__) || defined(__OpenBSD__)
8989

9090
#include <arpa/inet.h> /* __BYTE_ORDER */
91-
# if defined(linux)
91+
# if defined(linux) || defined(__linux__)
9292
# include <byteswap.h>
9393
# endif
9494

0 commit comments

Comments
 (0)