summaryrefslogtreecommitdiff
path: root/lib/replace/wscript
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2010-10-21 00:13:54 +0400
committerMatthieu Patou <mat@matws.net>2010-10-22 01:00:53 +0400
commit2d0ac59fcc490517b202180f49b178ab80c2534e (patch)
tree8d4ea0c932fec9cb4ab88b4586e54513e596cee9 /lib/replace/wscript
parentc529317fe2b48e045b35a613cfd1ad3f03b68435 (diff)
downloadsamba-2d0ac59fcc490517b202180f49b178ab80c2534e.tar.gz
samba-2d0ac59fcc490517b202180f49b178ab80c2534e.tar.bz2
samba-2d0ac59fcc490517b202180f49b178ab80c2534e.zip
replace: use a wrapper around strtoll if it didn't behave as expected
Diffstat (limited to 'lib/replace/wscript')
-rw-r--r--lib/replace/wscript17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/replace/wscript b/lib/replace/wscript
index 48871d6442..1778ea71b0 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -160,6 +160,23 @@ def configure(conf):
conf.CHECK_FUNCS('link readlink symlink realpath snprintf vsnprintf')
conf.CHECK_FUNCS('asprintf vasprintf setenv unsetenv strnlen strtoull __strtoull')
conf.CHECK_FUNCS('strtouq strtoll __strtoll strtoq')
+ #Some OS (ie. freebsd) return EINVAL if the convertion could not be done, it's not what we expect
+ #Let's detect those cases
+ if conf.CONFIG_SET('HAVE_STRTOLL'):
+ conf.CHECK_CODE('''
+ long long nb = strtoll("Text", NULL, 0);
+ if (errno == EINVAL) {
+ return 0;
+ } else {
+ return 1;
+ }
+ ''',
+ msg="Checking correct behavior of strtoll",
+ headers = 'errno.h',
+ execute = True,
+ define_ret = True,
+ define = 'HAVE_BSD_STRTOLL',
+ )
conf.CHECK_FUNCS('if_nametoindex strerror_r')
conf.CHECK_FUNCS('getdirentries getdents syslog')
conf.CHECK_FUNCS('gai_strerror get_current_dir_name')