From: Anders Carlsson Date: Tue, 4 Nov 2008 06:53:14 +0000 (+0000) Subject: #define NULL as 0 when compiling as C++. This fixes the carbon.cpp and cocoa.mm test... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f8e61b371d085516b8b9b906099db3e0b915a7c0;p=clang #define NULL as 0 when compiling as C++. This fixes the carbon.cpp and cocoa.mm test failures. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58685 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Headers/stddef.h b/lib/Headers/stddef.h index 3e7e4dda0d..d5f4eb9c7c 100644 --- a/lib/Headers/stddef.h +++ b/lib/Headers/stddef.h @@ -32,7 +32,12 @@ typedef __typeof__(sizeof(int)) size_t; typedef __typeof__(*L"") wchar_t; #endif +#ifdef __cplusplus +#define NULL (0) +#else #define NULL ((void*)0) +#endif + #define offsetof(t, d) __builtin_offsetof(t, d) #endif /* __STDDEF_H */