summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-05-20 23:33:07 +0200
committerwm4 <wm4@nowhere>2018-05-24 19:56:35 +0200
commit5ae271e4f43016c4ba36cc91e6811c75947028a4 (patch)
tree7c4f77f3f9f2ba5754c3e95ff18d66f09087d809
parent1ebc72d05ccba24609173ee15e9aefd725781d90 (diff)
downloadmpv-5ae271e4f43016c4ba36cc91e6811c75947028a4.tar.bz2
mpv-5ae271e4f43016c4ba36cc91e6811c75947028a4.tar.xz
build: prefer C11 mode
C99 still works, but in theory we're using C11 features already, such as stdatomic.h. gcc/clang let us use it in C99 mode too, but using C11 is at least more proper.
-rw-r--r--waftools/detections/compiler.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/waftools/detections/compiler.py b/waftools/detections/compiler.py
index 1befec5db5..55fa6d7b16 100644
--- a/waftools/detections/compiler.py
+++ b/waftools/detections/compiler.py
@@ -20,7 +20,12 @@ def __add_generic_flags__(ctx):
ctx.env.CFLAGS += ["-D_ISOC99_SOURCE", "-D_GNU_SOURCE",
"-D_LARGEFILE_SOURCE", "-D_FILE_OFFSET_BITS=64",
"-D_LARGEFILE64_SOURCE",
- "-std=c99", "-Wall"]
+ "-Wall"]
+
+ if ctx.check_cc(cflags="-std=c11", mandatory=False):
+ ctx.env.CFLAGS += ["-std=c11"]
+ else:
+ ctx.env.CFLAGS += ["-std=c99"]
if ctx.is_optimization():
ctx.env.CFLAGS += ['-O2']