summaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2019-01-27 20:27:42 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-01-29 22:09:07 +0100
commitb2050db67b47ab5d8ac9bf5b223b3a3289eb854e (patch)
tree57669b91e0e53c57f20ed974b85650558b7d9c28 /buildtools
parente49df24e80a1c0bc2a1cc46c026e2aebfd5d6ddd (diff)
downloadsamba-b2050db67b47ab5d8ac9bf5b223b3a3289eb854e.tar.gz
wafsamba/replace: move __STDC_WANT_LIB_EXT1__ to CFLAGS
This fixes the build of python bindings, which use memset_s() (via ZERO_STRUCT). In python bindings Python.h needs to be the first header, which means is already includes string.h. Defining __STDC_WANT_LIB_EXT1__ in replace.h is too late in that case. This fixes the --check-c-compiler=gcc --picky-developer on FreeBSD 12. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/wafsamba/wscript9
1 files changed, 9 insertions, 0 deletions
diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript
index 7b8fb01db5e..57d8a1504e1 100644
--- a/buildtools/wafsamba/wscript
+++ b/buildtools/wafsamba/wscript
@@ -444,6 +444,15 @@ def configure(conf):
conf.DEFINE('_GNU_SOURCE', 1, add_to_cflags=True)
conf.DEFINE('_XOPEN_SOURCE_EXTENDED', 1, add_to_cflags=True)
+ #
+ # Needs to be defined before std*.h and string*.h are included
+ # As Python.h already brings string.h we need it in CFLAGS.
+ # See memset_s() details here:
+ # https://en.cppreference.com/w/c/string/byte/memset
+ #
+ if conf.CHECK_CFLAGS(['-D__STDC_WANT_LIB_EXT1__=1'] + conf.env.WERROR_CFLAGS):
+ conf.ADD_CFLAGS('-D__STDC_WANT_LIB_EXT1__=1')
+
# on Tru64 certain features are only available with _OSF_SOURCE set to 1
# and _XOPEN_SOURCE set to 600
if conf.env['SYSTEM_UNAME_SYSNAME'] == 'OSF1':