From e9366b030c5a7151e5364463b212c7e41f0f666e Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Mon, 22 Apr 2024 16:48:50 +0800 Subject: [PATCH] Fix for missing AI_NUMERICSERV on < 10.6 --- ixwebsocket/IXDNSLookup.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git ixwebsocket/IXDNSLookup.cpp ixwebsocket/IXDNSLookup.cpp index 5966be23..cc39a383 100644 --- ixwebsocket/IXDNSLookup.cpp +++ ixwebsocket/IXDNSLookup.cpp @@ -35,6 +35,12 @@ #endif #endif +#ifdef __APPLE__ +#ifndef AI_NUMERICSERV +#define AI_NUMERICSERV 0 +#endif +#endif + namespace ix { const int64_t DNSLookup::kDefaultWait = 1; // ms From f315e1f91321cc436d48a0a86886d2b16403e77b Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Mon, 22 Apr 2024 16:52:09 +0800 Subject: [PATCH] Do not use pthread_setname_np on < 10.6 --- ixwebsocket/IXSetThreadName.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git ixwebsocket/IXSetThreadName.cpp ixwebsocket/IXSetThreadName.cpp index b1e77379..2f4ee75b 100644 --- ixwebsocket/IXSetThreadName.cpp +++ ixwebsocket/IXSetThreadName.cpp @@ -15,6 +15,10 @@ #include #endif +#ifdef __APPLE__ +#include +#endif + // Windows #ifdef _WIN32 #include @@ -58,7 +62,7 @@ namespace ix void setThreadName(const std::string& name) { -#if defined(__APPLE__) +#if defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) // // Apple reserves 16 bytes for its thread names // Notice that the Apple version of pthread_setname_np