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

Argyrios Kyrtzidis kyrtzidis at apple.com
Wed Mar 27 14:26:21 PDT 2013


On Mar 27, 2013, at 2:14 PM, Douglas Gregor <dgregor at apple.com> wrote:

> 
> On Mar 27, 2013, at 11:39 AM, Argyrios Kyrtzidis <kyrtzidis at apple.com> wrote:
> 
>> 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 ?
> 
> I don't think it's feasible in general. If we go down this route, then lib/Headers will be rife with the internal implementation details of various platforms. I don't think we want to live in that world.
> 
> … and we'll still never be able to take away the hack in r178109, because some other system won't have the right hacks in lib/Headers.

Point taken, reverted in r178181. Thanks for reviewing!

> 
> 	- Doug
> 
>>> 
>>> 	- 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
> 
> _______________________________________________
> 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/7a016cc8/attachment.html>


More information about the cfe-commits mailing list