Project

General

Profile

Feature #691 » 0070-Meson-Add-configure-checks-for-static-asserts.patch

main, S3_2 - Marko Lindqvist, 05/31/2024 01:06 AM

View differences:

gen_headers/meson_freeciv_config.h.in
/* Delta protocol enabled */
#mesondefine FREECIV_DELTA_PROTOCOL
/* C11 static assert supported */
#mesondefine FREECIV_C11_STATIC_ASSERT
/* C++11 static assert supported */
#mesondefine FREECIV_CXX11_STATIC_ASSERT
#endif /* FC__FREECIV_CONFIG_H */
meson.build
pub_conf_data.set('FREECIV_HAVE_LIBZSTD', 1)
endif
if c_compiler.compiles('''
#include <assert.h>
int main(void) { _Static_assert(1, "1 is not true"); }''',
name: 'c11 Static Assert')
pub_conf_data.set('FREECIV_C11_STATIC_ASSERT', 1)
endif
if cxx_build and cxx_compiler.compiles('''
#include <assert.h>
int main(void) { static_assert(1, "1 is not true"); }''',
name: 'c++11 Static Assert')
pub_conf_data.set('FREECIV_CXX11_STATIC_ASSERT', 1)
endif
# Check for c23 nullptr that can be passed as sentinel
if c_compiler.compiles('''
#include <stddef.h>
(1-1/2)