path: root/scons
diff options
authorJose Fonseca <>2015-03-20 06:53:09 +0000
committerJose Fonseca <>2015-03-22 08:23:24 +0000
commit15c5595bb144d8018ebd922c6914772958cbf2b2 (patch)
treed5e683bb87a2f5b44e3c9de28de078786089da81 /scons
parente4d95982ee36097a86c4afec3f34924964978c21 (diff)
scons: Ensure inttypes.h is always pre-included on MSVC.
It's a bit hackish couldn't find another solution. See code comment for details. The warning is useful, so universally disabling doesn't sound a good idea. Fixes warning C4005: 'xxx' : macro redefinition Reviewed-by: Brian Paul <>
Diffstat (limited to 'scons')
1 files changed, 7 insertions, 0 deletions
diff --git a/scons/ b/scons/
index 70504123d09..b4df1451f20 100755
--- a/scons/
+++ b/scons/
@@ -642,6 +642,13 @@ def generate(env):
# disable all MSVC extensions.
+ # Flex relies on __STDC_VERSION__>=199901L to decide when to include
+ # C99 inttypes.h. We always have inttypes.h available with MSVC
+ # (either the one bundled with MSVC 2013, or the one we bundle
+ # ourselves), but we can't just define __STDC_VERSION__ without
+ # breaking stuff, as MSVC doesn't fully support C99. There's also no
+ # way to premptively include stdint.
+ env.Append(CCFLAGS = ['-FIinttypes.h'])
if host_platform.system() == 'Windows':
# Prefer winflexbison binaries, as not only they are easier to install
# (no additional dependencies), but also better Windows support.