• Andreas Rheinhardt's avatar
    configure: Explicitly check for static_assert, _Static_assert · 0d43adcb
    Andreas Rheinhardt authored
    C11 provides static assertions via _Static_assert and
    provides static_assert as a convenience define for this
    in assert.h. Our codebase uses the latter, as _Static_assert
    has actually already been deprecated in C23.
    
    Not all toolchains that declare support for C11 actually
    support it; e.g. MSVC 19.27 does not support _Static_assert,
    but somehow supports static_assert. MSVC 19.27 admits to be
    a "preview implementation of the ISO C11 standard",
    so this is not surprising (MSVC 19.28 does not come with
    this caveat).
    
    Furthermore some FATE boxes [1] use old GCC toolchains (with
    only experimental support for C11) where _Static_assert is
    supported, but assert.h does not provide the fallback define.
    They are broken since the first usage of static_assert.
    
    This commit therefore checks whether static_assert and
    _Static_assert work with assert.h included; if not,
    configure errors out.
    
    This intentionally drops support for MSVC 19.27. Users like
    the old FATE boxes above can still add -Dstatic_assert=_Static_assert
    to cflags as a workaround if desired.
    
    [1]: https://fate.ffmpeg.org/report.cgi?time=20240321123620&slot=sh4-debian-qemu-gcc-4.7Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
    0d43adcb
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
ffbuild Loading commit data...
fftools Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING.GPLv2 Loading commit data...
COPYING.GPLv3 Loading commit data...
COPYING.LGPLv2.1 Loading commit data...
COPYING.LGPLv3 Loading commit data...
CREDITS Loading commit data...
Changelog Loading commit data...
INSTALL.md Loading commit data...
LICENSE.md Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
RELEASE Loading commit data...
configure Loading commit data...