]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: fix cross-compilation of LONG_MAX
authorasavah <asavah@avh.od.ua>
Sat, 17 Dec 2022 16:00:56 +0000 (17:00 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sun, 18 Dec 2022 09:24:14 +0000 (10:24 +0100)
https://github.com/systemd/systemd/pull/25618#issuecomment-1355019553

meson.build

index 1ddb42993a0525ec00b2dccd832cdcccfe761aa8..3c6734b578f837ce7a033014564410270c67f61c 100644 (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))