Skip to content

Commit c106e6c

Browse files
authored
Minor fixes for < 10.6 (#515)
* Fix for missing AI_NUMERICSERV on < 10.6 * Do not use pthread_setname_np on < 10.6
1 parent 1d210c0 commit c106e6c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

ixwebsocket/IXDNSLookup.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535
#endif
3636
#endif
3737

38+
#ifdef __APPLE__
39+
#ifndef AI_NUMERICSERV
40+
#define AI_NUMERICSERV 0
41+
#endif
42+
#endif
43+
3844
namespace ix
3945
{
4046
const int64_t DNSLookup::kDefaultWait = 1; // ms

ixwebsocket/IXSetThreadName.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
#include <pthread_np.h>
1616
#endif
1717

18+
#ifdef __APPLE__
19+
#include <AvailabilityMacros.h>
20+
#endif
21+
1822
// Windows
1923
#ifdef _WIN32
2024
#include <windows.h>
@@ -58,7 +62,7 @@ namespace ix
5862

5963
void setThreadName(const std::string& name)
6064
{
61-
#if defined(__APPLE__)
65+
#if defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1060)
6266
//
6367
// Apple reserves 16 bytes for its thread names
6468
// Notice that the Apple version of pthread_setname_np

0 commit comments

Comments
 (0)