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

Maxim Bublis b at codemonkey.ru
Mon Dec 9 14:55:36 CET 2013

> >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.

This behavior is defined by standard. If compiler doesn't implement this,
it is safe to define it way VLC currently does.

> >[+] 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?

static_assert is a keyword in C++11 and it shouldn't be defined in
<assert.h> or <cassert>, it is not buggy behavior.
But including <cassert> does inclusion of internal Apple's C++ library
compatibility header, which defines static_assert in case of compiler
lackness of static_assert support.

Maxim Bublis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20131209/ef7e9eff/attachment.html>

More information about the vlc-devel mailing list