diff options
author | Günther Deschner <gd@samba.org> | 2011-02-22 11:49:52 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2011-02-22 12:46:06 +0100 |
commit | bd333551bd5a2436773a1541a28e3e47c0e08533 (patch) | |
tree | 84735bf82e1120560a54410a5b478f0de7238f55 /source3 | |
parent | 2984003275ed415268b2e135bf71380ab9ae9ef3 (diff) | |
download | samba-bd333551bd5a2436773a1541a28e3e47c0e08533.tar.gz samba-bd333551bd5a2436773a1541a28e3e47c0e08533.tar.bz2 samba-bd333551bd5a2436773a1541a28e3e47c0e08533.zip |
s3-waf: add check for TIME_T_MAX.
Guenther
Diffstat (limited to 'source3')
-rw-r--r-- | source3/wscript | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source3/wscript b/source3/wscript index 2f73e7d95b..4df1680a9a 100644 --- a/source3/wscript +++ b/source3/wscript @@ -1232,6 +1232,31 @@ syscall(SYS_initgroups, 16, NULL, NULL, 0); if os.path.exists('/proc/sys/kernel/core_pattern'): conf.DEFINE('HAVE_SYS_KERNEL_PROC_CORE_PATTERN', '1') + if conf.CHECK_CODE(''' +#include <time.h> +main() { + struct tm *tm; + if (sizeof(time_t) == 8) { + time_t max_time = 0x7fffffffffffffffll; + tm = gmtime(&max_time); + /* This should fail with 32-bit tm_year. */ + if (tm == NULL) { + /* Max time_t that works with 32-bit int tm_year in struct tm. */ + max_time = 67768036191676799ll; + tm = gmtime(&max_time); + if (tm) { + exit(0); + } + } + } + exit(1); +}''', + '__TIME_T_MAX', + addmain=False, + execute=True, + msg="Checking for the maximum value of the 'time_t' type"): + conf.DEFINE('TIME_T_MAX', '67768036191676799ll') + default_static_modules=TO_LIST('''pdb_smbpasswd pdb_tdbsam pdb_wbc_sam auth_sam auth_unix auth_winbind auth_wbc auth_server auth_domain auth_builtin vfs_default |