Hi,

Marc Glisse <marc.gli...@inria.fr> skribis:

> On Tue, 31 Jan 2012, Ludovic Courtès wrote:
>
>> Hi,
>>
>> Chris Lattner <clatt...@apple.com> skribis:
>>
>>> On Jan 30, 2012, at 7:56 AM, Ludovic Courtès wrote:
>>>
>>>> Hello,
>>>>
>>>> Chris Lattner <clatt...@apple.com> skribis:
>>>>
>>>>> If fact, some do:
>>>>> http://clang.llvm.org/docs/LanguageExtensions.html#feature_check
>>>>
>>>> That seems like a very useful approach to solve the problem.
>>>>
>>>> The docs say that ‘__has_builtin’ & co. are macros.  What do they expand 
>>>> to?
>>>
>>> 0 or 1.
>>
>> I understand.  To put it another way, how are they defined?
>
> Compiler magic, like __LINE__ for instance? I am still not sure what
> you are asking...
>
> Interestingly enough:
> $ cat q.c
> __has_builtin
> $ clang -E q.c
> <segfault>

Yes, that’s what I was asking.

It makes me think that the old CPP predicates (info "(gcc) Obsolete
Features") would be more appropriate than compiler magic, with the
caveat that they’re presumably not widely supported.

Thanks,
Ludo’.

Reply via email to