-# 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
-# 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')