summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buildtools/wafsamba/samba_autoconf.py13
-rw-r--r--lib/replace/wscript1
2 files changed, 10 insertions, 4 deletions
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index fef44ea95b..7eac7d955f 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -48,11 +48,16 @@ def CHECK_TYPE_IN(conf, t, hdr):
return False
@conf
-def CHECK_TYPE(conf, t, alternate):
- if not conf.check(type_name=t, header_name=conf.env.hlist):
+def CHECK_TYPE(conf, t, alternate=None, headers=None, define=None):
+ if headers is None:
+ headers = conf.env.hlist
+ if define is not None:
+ ret = conf.check(type_name=t, header_name=headers, define_name=define)
+ else:
+ ret = conf.check(type_name=t, header_name=headers)
+ if not ret and alternate is not None:
conf.DEFINE(t, alternate)
- return True
- return False
+ return ret
@conf
def CHECK_VARIABLE(conf, v, define=None, always=False, headers=None):
diff --git a/lib/replace/wscript b/lib/replace/wscript
index b5a01d6a81..ef8972924b 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -100,6 +100,7 @@ def configure(conf):
conf.CHECK_TYPE('loff_t', 'off_t')
conf.CHECK_TYPE('bool', 'off_t')
conf.CHECK_TYPE('offset_t', 'loff_t')
+ conf.CHECK_TYPE('volatile int', define='HAVE_VOLATILE')
conf.CHECK_TYPE_IN('struct ifaddrs', 'ifaddrs.h')
conf.CHECK_TYPE_IN('struct addrinfo', 'netdb.h')