]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: time_t sign
authorFred Morcos <fred.morcos@open-xchange.com>
Mon, 3 Jul 2023 10:33:01 +0000 (12:33 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 20 Mar 2024 12:28:24 +0000 (13:28 +0100)
meson/timet-sign/meson.build [new file with mode: 0644]

diff --git a/meson/timet-sign/meson.build b/meson/timet-sign/meson.build
new file mode 100644 (file)
index 0000000..7b8e3b0
--- /dev/null
@@ -0,0 +1,19 @@
+# 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;
+}
+'''
+
+timet_signed = cxx.compiles(prog, name: 'time_t is signed')
+
+if not timet_signed
+  error('time_t is unsigned, PowerDNS code relies on it being signed')
+endif
+
+summary('Signed time_t', timet_signed, bool_yn: true, section: 'System')