chiark / gitweb /
util: add check that makes sure time_t and TIME_T_MAX work the way we assume they do
authorLennart Poettering <lennart@poettering.net>
Wed, 3 Feb 2016 20:05:59 +0000 (21:05 +0100)
committerSven Eden <yamakuzure@gmx.net>
Wed, 17 May 2017 13:22:16 +0000 (15:22 +0200)
src/basic/time-util.h

index 3d6dbff..61f263b 100644 (file)
@@ -69,7 +69,7 @@ typedef struct dual_timestamp {
 #define FORMAT_TIMESTAMP_RELATIVE_MAX 256
 #define FORMAT_TIMESPAN_MAX 64
 
-#define TIME_T_MAX (time_t)((1UL << ((sizeof(time_t) << 3) - 1)) - 1)
+#define TIME_T_MAX (time_t)((UINTMAX_C(1) << ((sizeof(time_t) << 3) - 1)) - 1)
 
 #define DUAL_TIMESTAMP_NULL ((struct dual_timestamp) { 0ULL, 0ULL })