[cfe-commits] r98006 - /cfe/trunk/lib/Headers/stddef.h
Ted Kremenek
kremenek at apple.com
Mon Mar 8 15:23:45 PST 2010
Author: kremenek
Date: Mon Mar 8 17:23:45 2010
New Revision: 98006
URL: http://llvm.org/viewvc/llvm-project?rev=98006&view=rev
Log:
Add preprocessor guards to the definitions of size_t and wchar_t, and #undef NULL before defining it.
This addresses potential issues with system headers reported in <rdar://problem/7727159>.
Modified:
cfe/trunk/lib/Headers/stddef.h
Modified: cfe/trunk/lib/Headers/stddef.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/stddef.h?rev=98006&r1=98005&r2=98006&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/stddef.h (original)
+++ cfe/trunk/lib/Headers/stddef.h Mon Mar 8 17:23:45 2010
@@ -27,11 +27,18 @@
#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
More information about the cfe-commits
mailing list