]> granicus.if.org Git - clang/commitdiff
Add preprocessor guards to the definitions of size_t and wchar_t, and #undef NULL...
authorTed Kremenek <kremenek@apple.com>
Mon, 8 Mar 2010 23:23:45 +0000 (23:23 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 8 Mar 2010 23:23:45 +0000 (23:23 +0000)
This addresses potential issues with system headers reported in <rdar://problem/7727159>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98006 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Headers/stddef.h

index 2c84b4b066c950c8478b0a7852cb2f0d9db99314..6868ad341fd6147613729b82472f627dd6ee5186 100644 (file)
 #define __STDDEF_H
 
 typedef __typeof__(((int*)0)-((int*)0)) ptrdiff_t;
+#ifndef _SIZE_T
+#define _SIZE_T
 typedef __typeof__(sizeof(int)) size_t;
+#endif
 #ifndef __cplusplus
+#ifndef _WCHAR_T
+#define _WCHAR_T
 typedef __typeof__(*L"") wchar_t;
 #endif
+#endif
 
+#undef NULL
 #ifdef __cplusplus
 #define NULL __null
 #else