chiark / gitweb /
util: add check that makes sure time_t and TIME_T_MAX work the way we assume they do
[elogind.git] / src / basic / time-util.h
index 3d6dbff35ccadd5f98932711b5dc0d1ee448b907..61f263baeaaeb666c1002e702766df7517335177 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 })