From e976cf2de458b0d7e5d7c88e56642334411dbb4b Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Tue, 5 Nov 2019 02:44:02 +0500 Subject: [PATCH] wscript: Use better check for tgmath.h. --- wscript | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wscript b/wscript index cd8dbae7..d7d84466 100644 --- a/wscript +++ b/wscript @@ -200,7 +200,12 @@ def configure(conf): # check if we can use C99 tgmath if conf.check_cc(header_name='tgmath.h', mandatory=False): - conf.env.define('HAVE_TGMATH_H', 1) + tgmath_usable = conf.check_cc(fragment='''#include + int main(void){ return (int)sin(2.0f); }''', + msg='Checking if tgmath.h is usable', mandatory=False): + conf.define_cond('HAVE_TGMATH_H', tgmath_usable) + else: + conf.undefine('HAVE_TGMATH_H') if conf.env.COMPILER_CC == 'msvc': conf.define('_CRT_SECURE_NO_WARNINGS', 1)