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:
Azat Khuzhin 2023-05-14 22:00:19 +02:00
parent 5f1fc92b13
commit 6eba967e1c

View File

@ -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)