[vlc-devel] [PATCH] Added check for _Static_assert and C++11 static_assert.

Rafaël Carré rafael.carre at gmail.com
Mon Dec 9 14:26:54 CET 2013




Maxim Bublis <b at codemonkey.ru> a écrit :
>>
>> I've done some research recently, and would like to share results
>with you.
>>
>
>So, in my opinion following behavior should be implemented:
>
>A. Building C code:
>[+] Compiler doesn't have _Static_assert -> define _Static_assert

I think we don't need to touch _Static_assert, if the compiler doesn't implement it there's not much we can do.

>[+] Standard C library doesn't define static_assert -> define
>static_assert

IMO that's the only bug here, fixed by -Dstatic_assert=_Static_assert

>B. Building C++ code:
>[+] Compiler doesn't have _Static_assert -> define _Static_assert
>[-] Compiler doesn't support static_assert keyword AND ([+] Standard
>C++
>library doesn't define static_assert) -> define static_assert

Is Apple C++ assert.h buggy too?

>[+] and [-] shows implementation state of this behavior in my patch.
>
>So, here is the question: should we try to build VLC with -std=c++11
>(or
>-std=c++0x in case of GCC 4.6 and earlier)?
>If it is not desired, patch already fixes all possible cases.
>If it is desired I will add check for compiler -std=c++11 flag support,
>and
>check for static_assert support with this flag enabled.

-- 
Envoyé de mon téléphone Android avec K-9 Mail. Excusez la brièveté.



More information about the vlc-devel mailing list