aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-05-05 16:58:18 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-05-05 17:37:07 +0530
commitf14684c5cb2241665e9ea152f842632b70f4296b (patch)
treec299190bff46203496db50d6f88fa7cd1629830d /mesonbuild/compilers.py
parent11968382a3800f7dd6d04b3a94d4351f0950dd9a (diff)
downloadmeson-f14684c5cb2241665e9ea152f842632b70f4296b.zip
meson-f14684c5cb2241665e9ea152f842632b70f4296b.tar.gz
meson-f14684c5cb2241665e9ea152f842632b70f4296b.tar.bz2
get_define: Add prefix before ifndef block
Otherwise the compiler will warn about macros being redefined.
Diffstat (limited to 'mesonbuild/compilers.py')
-rw-r--r--mesonbuild/compilers.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index 3d2cd96..f4439dc 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -1139,10 +1139,10 @@ class CCompiler(Compiler):
delim = '"MESON_GET_DEFINE_DELIMITER"'
fargs = {'prefix': prefix, 'define': dname, 'delim': delim}
code = '''
+ {prefix}
#ifndef {define}
# define {define}
#endif
- {prefix}
{delim}\n{define}'''
args = self._get_compiler_check_args(env, extra_args, dependencies,
mode='preprocess').to_native()