From a8c6fd6aa4511ea0cc419c50fb6ed62c6b3961aa Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Mon, 28 Mar 2016 20:42:11 +0530 Subject: [PATCH] compilers: Return -1 from cc.sizeof if the symbol could not be found Allows people to avoid adding a separate check for the symbol existing in case it's platform-specific --- mesonbuild/compilers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index ba5c269d8..9afff2b44 100644 --- a/mesonbuild/compilers.py +++ b/mesonbuild/compilers.py @@ -574,7 +574,7 @@ int main(int argc, char **argv) { ''' res = self.run(templ % (prefix, element), extra_args) if not res.compiled: - raise EnvironmentException('Could not compile sizeof test.') + return -1 if res.returncode != 0: raise EnvironmentException('Could not run sizeof test binary.') return int(res.stdout)