Skip to content

Commit

Permalink
Minor fixes for < 10.6 (#515)
Browse files Browse the repository at this point in the history
* Fix for missing AI_NUMERICSERV on < 10.6

* Do not use pthread_setname_np on < 10.6
  • Loading branch information
barracuda156 authored May 8, 2024
1 parent 1d210c0 commit c106e6c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ixwebsocket/IXDNSLookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion ixwebsocket/IXSetThreadName.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
#include <pthread_np.h>
#endif

#ifdef __APPLE__
#include <AvailabilityMacros.h>
#endif

// Windows
#ifdef _WIN32
#include <windows.h>
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c106e6c

Please sign in to comment.