diff options
author | Martin Thomson <mt@lowentropy.net> | 2019-10-28 22:55:09 +0000 |
---|---|---|
committer | Martin Thomson <mt@lowentropy.net> | 2019-10-28 22:55:09 +0000 |
commit | 021a5d411267b3fc51fac4034452e2a74306c45d (patch) | |
tree | 41d290ec762fcc28095fcdef4510679f8f87e5ea /coreconf/WIN32.mk | |
parent | ea541a79dd10a11fbcd861101ebe3d49aa5c8814 (diff) | |
download | nss-hg-021a5d411267b3fc51fac4034452e2a74306c45d.tar.gz |
Bug 1590972 - Use -std=c99 for all C code, r=jcj
This switches to using -std=c99 for compiling all C code. Previously, we only
enabled this option for lib/freebl and lib/ssl.
For Linux, this means we need to define _DEFAULT_SOURCE to access some of the
functions we use. On glibc 2.12 (our oldest supported version), we also need to
define _BSD_SOURCE to access these functions.
The only tricky part is dealing with partial C99 implementation in gcc 4.4.
From what I've seen, the only problem is that - in that mode - it doesn't
support nesting of unnamed fields:
https://gcc.gnu.org/onlinedocs/gcc-4.4.7/gcc/Unnamed-Fields.html
This also switches from -std=c++0x to -std=c++11 as the 0x variant, though
identical in meaning, is deprecated.
Differential Revision: https://phabricator.services.mozilla.com/D50421
Diffstat (limited to 'coreconf/WIN32.mk')
-rw-r--r-- | coreconf/WIN32.mk | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/coreconf/WIN32.mk b/coreconf/WIN32.mk index 7269cc7a2..ac1a454bc 100644 --- a/coreconf/WIN32.mk +++ b/coreconf/WIN32.mk @@ -261,6 +261,12 @@ else endif endif +# clear any CSTD and CXXSTD unless we're using GCC +ifndef NS_USE_GCC + CSTD = + CXXSTD = +endif + # # override the definitions of RELEASE_TREE found in tree.mk # |