meson: fix cross-compilation of LONG_MAX

https://github.com/systemd/systemd/pull/25618#issuecomment-1355019553
This commit is contained in:
asavah 2022-12-17 17:00:56 +01:00 committed by Luca Boccassi
parent f12b399dd6
commit 2736a0c64e

View file

@ -510,7 +510,11 @@ conf.set('SIZEOF_TIME_T', cc.sizeof('time_t', prefix : '#include <sys/time.h>'))
conf.set('SIZEOF_RLIM_T', cc.sizeof('rlim_t', prefix : '#include <sys/resource.h>'))
conf.set('SIZEOF_TIMEX_MEMBER', cc.sizeof('typeof(((struct timex *)0)->freq)', prefix : '#include <sys/timex.h>'))
long_max = cc.compute_int('LONG_MAX', prefix : '#include <limits.h>')
long_max = cc.compute_int(
'LONG_MAX',
prefix : '#include <limits.h>',
guess : 0x7FFFFFFFFFFFFFFF,
high : 0x7FFFFFFFFFFFFFFF)
assert(long_max > 100000)
conf.set_quoted('LONG_MAX_STR', '@0@'.format(long_max))