aerospike / aerospike-client-c

Aerospike C Client
Other
98 stars 103 forks source link

warning: 'MSG_NOSIGNAL' macro redefined (on macOS) #103

Closed bsergean closed 3 years ago

bsergean commented 3 years ago
/.../include/aerospike/as_socket.h:42:9: warning: 'MSG_NOSIGNAL' macro redefined [-Wmacro-redefined]
#define MSG_NOSIGNAL 0
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/usr/include/sys/socket.h:584:9: note: previous definition is here
#define MSG_NOSIGNAL    0x80000         /* do not generate SIGPIPE on EOF */
        ^

Current code block is:

#if defined(__APPLE__)
#define SOL_TCP IPPROTO_TCP
#define MSG_NOSIGNAL 0
#endif

I believe this would fix it:

#if defined(__APPLE__)
#define SOL_TCP IPPROTO_TCP
#ifdef MSG_NOSIGNAL
#undef MSG_NOSIGNAL
#endif
#define MSG_NOSIGNAL 0
#endif
bsergean commented 3 years ago

Oh it looks like it was already fixed -> https://github.com/aerospike/aerospike-client-c/commit/728c9f0565e1c1a7bb2e442b0016e74f9d274d06