mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Suppress -Wmacro-redefined for htonll/ntohll in OSX
OSX: test/regress_ws.c:61:9: warning: 'htonll' macro redefined [-Wmacro-redefined] #define htonll(x) \ ^ /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/sys/_endian.h:141:9: note: previous definition is here #define htonll(x) __DARWIN_OSSwapInt64(x) ^ test/regress_ws.c:65:9: warning: 'ntohll' macro redefined [-Wmacro-redefined] #define ntohll(x) htonll(x) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/sys/_endian.h:140:9: note: previous definition is here #define ntohll(x) __DARWIN_OSSwapInt64(x) ^
This commit is contained in:
parent
5f1fc92b13
commit
6eba967e1c
@ -58,10 +58,12 @@
|
||||
#include "regress_http.h"
|
||||
#include "regress_ws.h"
|
||||
|
||||
#undef htonll
|
||||
#define htonll(x) \
|
||||
((1 == htonl(1)) \
|
||||
? (x) \
|
||||
: ((uint64_t)htonl((x)&0xFFFFFFFF) << 32) | htonl((x) >> 32))
|
||||
#undef ntohll
|
||||
#define ntohll(x) htonll(x)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user