From: Helmut Grohne <hel...@subdivi.de> Signed-off-by: Helmut Grohne <hel...@subdivi.de> Signed-off-by: Adam Borowski <kilob...@angband.pl> --- meson.build | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/meson.build b/meson.build index 20a646d..70911b1 100644 --- a/meson.build +++ b/meson.build @@ -231,19 +231,18 @@ conf.set('ENABLE_DESTRUCTIVE', get_option('destructive').enabled()) conf.set('ENABLE_LOGGING', get_option('logging').enabled()) conf.set('ENABLE_DEBUG', get_option('dbg').enabled()) -typeof = cc.run(''' - int main() { +typeof_code = ''' + void func() { struct { char a[16]; } x; typeof(x) y; - return sizeof(x) == sizeof(y); + char static_assert[2 * (sizeof(x) == sizeof(y)) - 1]; } ''' -) -if typeof.compiled() and typeof.returncode() == 1 +if cc.compiles(typeof_code) conf.set('HAVE_TYPEOF', 1) conf.set('HAVE_STATEMENT_EXPR', 1) endif -- 2.37.2