]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: Cleanup time_t modules
authorFred Morcos <fred.morcos@open-xchange.com>
Tue, 15 Aug 2023 22:04:45 +0000 (00:04 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 20 Mar 2024 12:28:39 +0000 (13:28 +0100)
meson/timet-sign/meson.build
meson/timet-sign/timet_sign.cc [new file with mode: 0644]
meson/timet-size/meson.build

index 7b8e3b0b5d7314b4a1ebbd5e9b36e672c762e00e..66349cd9a1c2167fa5192aec025551da47334a67 100644 (file)
@@ -1,15 +1,4 @@
-# Check the sign of time_t
-
-prog = '''
-#include <sys/types.h>
-
-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 (file)
index 0000000..f954bfa
--- /dev/null
@@ -0,0 +1,7 @@
+#include <sys/types.h>
+
+int main() {
+  int foo[1 - 2 * !(((time_t) -1) < 0)];
+  (void)foo[0];
+  return 0;
+}
index 5e47c868ba1ee57896e4d2ae70d2f22deda11121..5f0c060a359505281e55cc86c0fb454f4c11fe39 100644 (file)
@@ -1,9 +1,9 @@
-# Check the size of time_t
-
 timet_size = cxx.sizeof('time_t', prefix: '#include <sys/types.h>')
 
 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')