]> git.saurik.com Git - apple/xnu.git/blobdiff - EXTERNAL_HEADERS/stddef.h
xnu-7195.50.7.100.1.tar.gz
[apple/xnu.git] / EXTERNAL_HEADERS / stddef.h
index d9bb51e83205c050ff17bd57ca69bc679369bfa5..9678b998fa4d9828b7464b522f4a7ab8f8dbf626 100644 (file)
 #ifndef __STDDEF_H
 #define __STDDEF_H
 
+#undef NULL
+#ifdef __cplusplus
+#if __cplusplus >= 201103L
+#define NULL nullptr
+#else
+#undef __null  // VC++ hack.
+#define NULL __null
+#endif
+#else
+#define NULL ((void*)0)
+#endif
+
 #ifndef _PTRDIFF_T
 #define _PTRDIFF_T
-typedef __typeof__(((int*)0)-((int*)0)) ptrdiff_t;
+typedef __typeof__(((int*)NULL)-((int*)NULL)) ptrdiff_t;
 #endif
 #ifndef _SIZE_T
 #define _SIZE_T
@@ -41,14 +53,6 @@ typedef __WCHAR_TYPE__ wchar_t;
 #endif
 #endif
 
-#undef NULL
-#ifdef __cplusplus
-#undef __null  // VC++ hack.
-#define NULL __null
-#else
-#define NULL ((void*)0)
-#endif
-
 #ifndef offsetof
 #define offsetof(t, d) __builtin_offsetof(t, d)
 #endif