From: Ted Kremenek Date: Mon, 8 Mar 2010 23:23:45 +0000 (+0000) Subject: Add preprocessor guards to the definitions of size_t and wchar_t, and #undef NULL... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=21259bafdc0e113c8bdce51d7911cc9880da1892;p=clang 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 . git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98006 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Headers/stddef.h b/lib/Headers/stddef.h index 2c84b4b066..6868ad341f 100644 --- a/lib/Headers/stddef.h +++ b/lib/Headers/stddef.h @@ -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