From bd333551bd5a2436773a1541a28e3e47c0e08533 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 22 Feb 2011 11:49:52 +0100 Subject: s3-waf: add check for TIME_T_MAX. Guenther --- source3/wscript | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'source3') 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 +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 -- cgit