diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py index 8b499825230..78927d85193 100644 --- a/buildtools/wafsamba/samba_autoconf.py +++ b/buildtools/wafsamba/samba_autoconf.py @@ -343,6 +343,23 @@ def CHECK_SIZEOF(conf, vars, headers=None, define=None, critical=True): sys.exit(1) return ret +@conf +def CHECK_SIGN(conf, v, headers=None): + '''check the sign of a type''' + define_name = v.upper().replace(' ', '_') + for op, signed in [('<', 'signed'), + ('>', 'unsigned')]: + if CHECK_CODE(conf, + f'static int test_array[1 - 2 * !((({v})-1) {op} 0)];', + define=f'{define_name}_{signed.upper()}', + quote=False, + headers=headers, + local_include=False, + msg=f"Checking if '{v}' is {signed}"): + return True + + return False + @conf def CHECK_VALUEOF(conf, v, headers=None, define=None): '''check the value of a variable/define''' diff --git a/third_party/heimdal_build/wscript_configure b/third_party/heimdal_build/wscript_configure index 023935d98c0..0021cd328ec 100644 --- a/third_party/heimdal_build/wscript_configure +++ b/third_party/heimdal_build/wscript_configure @@ -206,3 +206,5 @@ if conf.CONFIG_SET('USING_EMBEDDED_HEIMDAL'): conf.define('HAVE_KRB5_ADDLOG_FUNC_NEED_CONTEXT', 1) else: pass # TODO + +conf.CHECK_SIGN('time_t')