Old MacOS SDKs require you include sys/socket.h before net/if.h (#673)

Old MacOS SDKs (like 10.8) require you include `sys/socket.h` before you include `net/if.h` as reported by MacPorts.  Using a new SDK but with setting the macos target version does not have the same issue.

Fixes Issue: #672 
Fix By: Brad House (@bradh352)
pull/676/head
Brad House 11 months ago committed by GitHub
parent 1e34608cc9
commit eef64443d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      CMakeLists.txt

@ -210,7 +210,12 @@ CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H)
CHECK_INCLUDE_FILES (memory.h HAVE_MEMORY_H)
CHECK_INCLUDE_FILES (netdb.h HAVE_NETDB_H)
CHECK_INCLUDE_FILES (netinet/in.h HAVE_NETINET_IN_H)
# On old MacOS SDK versions, you must include sys/socket.h before net/if.h
IF (HAVE_SYS_SOCKET_H)
CHECK_INCLUDE_FILES ("sys/socket.h;net/if.h" HAVE_NET_IF_H)
ELSE ()
CHECK_INCLUDE_FILES (net/if.h HAVE_NET_IF_H)
ENDIF ()
CHECK_INCLUDE_FILES (signal.h HAVE_SIGNAL_H)
CHECK_INCLUDE_FILES (socket.h HAVE_SOCKET_H)
CHECK_INCLUDE_FILES (stdbool.h HAVE_STDBOOL_H)

Loading…
Cancel
Save