From: Fred Morcos Date: Tue, 15 Aug 2023 22:04:45 +0000 (+0200) Subject: Meson: Cleanup time_t modules X-Git-Tag: rec-5.1.0-alpha1~80^2~227 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ddea7f42b764f3ea69b86530bd4a0aa065725091;p=thirdparty%2Fpdns.git Meson: Cleanup time_t modules --- diff --git a/meson/timet-sign/meson.build b/meson/timet-sign/meson.build index 7b8e3b0b5d..66349cd9a1 100644 --- a/meson/timet-sign/meson.build +++ b/meson/timet-sign/meson.build @@ -1,15 +1,4 @@ -# Check the sign of time_t - -prog = ''' -#include - -int main() { - int foo[1 - 2 * !(((time_t) -1) < 0)]; - (void)foo[0]; - return 0; -} -''' - +prog = fs.read('timet_sign.cc') timet_signed = cxx.compiles(prog, name: 'time_t is signed') if not timet_signed diff --git a/meson/timet-sign/timet_sign.cc b/meson/timet-sign/timet_sign.cc new file mode 100644 index 0000000000..f954bfaf6d --- /dev/null +++ b/meson/timet-sign/timet_sign.cc @@ -0,0 +1,7 @@ +#include + +int main() { + int foo[1 - 2 * !(((time_t) -1) < 0)]; + (void)foo[0]; + return 0; +} diff --git a/meson/timet-size/meson.build b/meson/timet-size/meson.build index 5e47c868ba..5f0c060a35 100644 --- a/meson/timet-size/meson.build +++ b/meson/timet-size/meson.build @@ -1,9 +1,9 @@ -# Check the size of time_t - timet_size = cxx.sizeof('time_t', prefix: '#include ') if timet_size < 8 - error('size of time_t is ' + timet_size.to_string() + ' which is not large enough to fix the y2k38 bug') + error('size of time_t is ' + + timet_size.to_string() + + ' which is not large enough to fix the y2k38 bug') endif summary('Size of time_t', timet_size, section: 'System')