]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/sys/cdefs.h
xnu-2782.20.48.tar.gz
[apple/xnu.git] / bsd / sys / cdefs.h
index ede0beecd3269a1ce3783200ef639c4738314167..7c729026f904ec543af282b1f2b84a62a5f96d66 100644 (file)
 # define __header_always_inline    __header_inline
 #endif
 
+/*
+ * Compiler-dependent macros that bracket portions of code where the
+ * "-Wunreachable-code" warning should be ignored. Please use sparingly.
+ */
+#if defined(__clang__)
+# define __unreachable_ok_push \
+         _Pragma("clang diagnostic push") \
+         _Pragma("clang diagnostic ignored \"-Wunreachable-code\"")
+# define __unreachable_ok_pop \
+         _Pragma("clang diagnostic pop")
+#elif defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
+# define __unreachable_ok_push \
+         _Pragma("GCC diagnostic push") \
+         _Pragma("GCC diagnostic ignored \"-Wunreachable-code\"")
+# define __unreachable_ok_pop \
+         _Pragma("GCC diagnostic pop")
+#else
+# define __unreachable_ok_push
+# define __unreachable_ok_pop
+#endif
+
 /*
  * Compiler-dependent macros to declare that functions take printf-like
  * or scanf-like arguments.  They are null except for versions of gcc
 #define __DARWIN_ONLY_64_BIT_INO_T     0
 #define __DARWIN_ONLY_UNIX_CONFORMANCE 0
 #define __DARWIN_ONLY_VERS_1050                0
-#define        __DARWIN_SUF_DARWIN10   "_darwin10"
-#define        __DARWIN10_ALIAS(sym)   __asm("_" __STRING(sym) __DARWIN_SUF_DARWIN10)
+#if defined(__x86_64__)
+#define        __DARWIN_SUF_DARWIN14   "_darwin14"
+#define        __DARWIN14_ALIAS(sym)   __asm("_" __STRING(sym) __DARWIN_SUF_DARWIN14)
+#else
+#define        __DARWIN14_ALIAS(sym)
+#endif
 #else /* !KERNEL */
 #ifdef PLATFORM_iPhoneOS
 /* Platform: iPhoneOS */
 #define __DARWIN_ONLY_UNIX_CONFORMANCE 1
 #define __DARWIN_ONLY_VERS_1050                1
 #endif /* PLATFORM_iPhoneSimulator */
+#ifdef PLATFORM_iPhoneOSNano
+/* Platform: iPhoneOSNano */
+#define __DARWIN_ONLY_64_BIT_INO_T     1
+#define __DARWIN_ONLY_UNIX_CONFORMANCE 1
+#define __DARWIN_ONLY_VERS_1050                1
+#endif /* PLATFORM_iPhoneOSNano */
+#ifdef PLATFORM_iPhoneNanoSimulator
+/* Platform: iPhoneNanoSimulator */
+#define __DARWIN_ONLY_64_BIT_INO_T     1
+#define __DARWIN_ONLY_UNIX_CONFORMANCE 1
+#define __DARWIN_ONLY_VERS_1050                1
+#endif /* PLATFORM_iPhoneNanoSimulator */
 #ifdef PLATFORM_MacOSX
 /* Platform: MacOSX */
 #define __DARWIN_ONLY_64_BIT_INO_T     0
 #define __DARWIN_ALIAS(sym)            __asm("_" __STRING(sym) __DARWIN_SUF_UNIX03)
 #define __DARWIN_ALIAS_C(sym)          __asm("_" __STRING(sym) __DARWIN_SUF_NON_CANCELABLE __DARWIN_SUF_UNIX03)
 #define __DARWIN_ALIAS_I(sym)          __asm("_" __STRING(sym) __DARWIN_SUF_64_BIT_INO_T __DARWIN_SUF_UNIX03)
+#define __DARWIN_NOCANCEL(sym)         __asm("_" __STRING(sym) __DARWIN_SUF_NON_CANCELABLE)
 #define __DARWIN_INODE64(sym)          __asm("_" __STRING(sym) __DARWIN_SUF_64_BIT_INO_T)
 
 #define __DARWIN_1050(sym)             __asm("_" __STRING(sym) __DARWIN_SUF_1050)