Merge pull request #294 from compnerd/inclusivity

linux: update header used for `major` macro
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5d9e470..0b7e55e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -156,7 +156,6 @@
 check_include_files("stdlib.h" HAVE_STDLIB_H)
 check_include_files("string.h" HAVE_STRING_H)
 check_include_files("strings.h" HAVE_STRINGS_H)
-check_include_files("sys/cdefs.h" HAVE_SYS_CDEFS_H)
 check_include_files("sys/guarded.h" HAVE_SYS_GUARDED_H)
 check_include_files("sys/stat.h" HAVE_SYS_STAT_H)
 check_include_files("sys/types.h" HAVE_SYS_TYPES_H)
diff --git a/cmake/config.h.in b/cmake/config.h.in
index 6696e98..97c94cc 100644
--- a/cmake/config.h.in
+++ b/cmake/config.h.in
@@ -176,9 +176,6 @@
 /* Define to 1 if you have the `sysconf' function. */
 #cmakedefine01 HAVE_SYSCONF
 
-/* Define to 1 if you have the <sys/cdefs.h> header file. */
-#cmakedefine01 HAVE_SYS_CDEFS_H
-
 /* Define to 1 if you have the <sys/guarded.h> header file. */
 #cmakedefine HAVE_SYS_GUARDED_H
 
diff --git a/os/linux_base.h b/os/linux_base.h
index c8b9cad..58b4971 100644
--- a/os/linux_base.h
+++ b/os/linux_base.h
@@ -13,9 +13,12 @@
 #ifndef __OS_LINUX_BASE__
 #define __OS_LINUX_BASE__
 
+#if __has_include(<sys/sysmacros.h>)
+#include <sys/sysmacros.h>
+#endif
 #include <sys/param.h>
 
-#if HAVE_SYS_CDEFS_H
+#if __has_include(<sys/cdefs.h>)
 #include <sys/cdefs.h>
 #endif
 
diff --git a/private/private.h b/private/private.h
index ed9f876..228ce2c 100644
--- a/private/private.h
+++ b/private/private.h
@@ -28,7 +28,12 @@
 #define __DISPATCH_PRIVATE__
 
 #ifdef __APPLE__
+#include <Availability.h>
+#include <os/availability.h>
 #include <TargetConditionals.h>
+#include <os/base.h>
+#elif defined(__linux__)
+#include <os/linux_base.h>
 #endif
 
 #if TARGET_OS_MAC
@@ -39,9 +44,6 @@
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#if HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
 #include <pthread.h>
 #if TARGET_OS_MAC
 #include <pthread/qos.h>