[FFmpeg-devel] [PATCH] Use __clang_version__ when available

David Conrad lessen42
Fri Jul 2 23:05:40 CEST 2010


On Jun 29, 2010, at 12:04 PM, M?ns Rullg?rd wrote:

> David Conrad <lessen42 at gmail.com> writes:
> 
>> On Jun 29, 2010, at 10:48 AM, M?ns Rullg?rd wrote:
>> 
>>> David Conrad <lessen42 at gmail.com> writes:
>>> 
>>>> On Jun 29, 2010, at 7:29 AM, M?ns Rullg?rd wrote:
>>>> 
>>>>> David Conrad <lessen42 at gmail.com> writes:
>>>>> 
>>>>>> ---
>>>>>> configure |    2 +-
>>>>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>>>> 
>>>>>> diff --git a/configure b/configure
>>>>>> index 60775b5..8aebe5a 100755
>>>>>> --- a/configure
>>>>>> +++ b/configure
>>>>>> @@ -1752,7 +1752,7 @@ elif $cc -version 2>/dev/null | grep -q TMS470; then
>>>>>>   }
>>>>>> elif $cc -v 2>&1 | grep -q clang; then
>>>>>>   cc_type=clang
>>>>>> -    cc_version=__VERSION__
>>>>>> +    check_cpp_condition stdlib.h "defined(__clang_version__)" && cc_version=__clang_version__ || cc_version=__VERSION__
>>>>> 
>>>>> Is __clang_version__ ever undefined?
>>>> 
>>>> Yes, in any clang older than ~2 months, including all official releases.
>>> 
>>> You're not allowed to run the compiler at that point since some things
>>> haven't been set up properly yet.  Does the following work?
>>> 
>>> $cc -dM -E $TMPC | grep -q __clang_version__ && ... || ...
>> 
>> Indeed it does
>> 
>> 
>> commit 9705f75b565bd5057edba76885db14fa8f1c865b
>> Author: David Conrad <lessen42 at gmail.com>
>> Date:   Sun Jun 27 16:21:08 2010 -0400
>> 
>>    Use __clang_version__ when available
>> 
>> diff --git a/configure b/configure
>> index 60775b5..63e0769 100755
>> --- a/configure
>> +++ b/configure
>> @@ -1752,7 +1752,7 @@ elif $cc -version 2>/dev/null | grep -q TMS470; then
>>     }
>> elif $cc -v 2>&1 | grep -q clang; then
>>     cc_type=clang
>> -    cc_version=__VERSION__
>> +    $cc -dM -E $TMPC | grep -q __clang_version__ && cc_version=__clang_version__ || cc_version=__VERSION__
> 
> OK if you break the line after the &&.

Applied



More information about the ffmpeg-devel mailing list