r178110 - [lib/Headers] Define NULL as __DARWIN_NULL when on __APPLE__.

Argyrios Kyrtzidis kyrtzidis at apple.com
Wed Mar 27 11:39:58 PDT 2013


On Mar 27, 2013, at 10:54 AM, Douglas Gregor <dgregor at apple.com> wrote:

> 
> On Mar 26, 2013, at 6:25 PM, Argyrios Kyrtzidis <akyrtzi at gmail.com> wrote:
> 
>> Author: akirtzidis
>> Date: Tue Mar 26 20:25:37 2013
>> New Revision: 178110
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=178110&view=rev
>> Log:
>> [lib/Headers] Define NULL as __DARWIN_NULL when on __APPLE__.
>> 
>> This makes it identical with the system definition.
> 
> Does r178109 obviate the need for this change?

Yes, but it's nice to have; r178109 is kinda "hacky" that will hopefully be reverted at some point.

Unless you don't think such a change is appropriate in general ?

> 
> 	- Doug
> 
>> 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=178110&r1=178109&r2=178110&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/Headers/stddef.h (original)
>> +++ cfe/trunk/lib/Headers/stddef.h Tue Mar 26 20:25:37 2013
>> @@ -53,7 +53,9 @@ typedef __WCHAR_TYPE__ wchar_t;
>> #endif
>> 
>> #undef NULL
>> -#ifdef __cplusplus
>> +#if defined(__APPLE__) && defined(__DARWIN_NULL)
>> +#  define NULL __DARWIN_NULL
>> +#elif defined(__cplusplus)
>> #  if !defined(__MINGW32__) && !defined(_MSC_VER)
>> #    define NULL __null
>> #  else
>> 
>> 
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130327/ae409cdb/attachment.html>


More information about the cfe-commits mailing list