aboutsummaryrefslogtreecommitdiffstats
path: root/common/t-gettime.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/t-gettime.c')
-rw-r--r--common/t-gettime.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/common/t-gettime.c b/common/t-gettime.c
index 9d9881a23..13cb1a2f7 100644
--- a/common/t-gettime.c
+++ b/common/t-gettime.c
@@ -20,9 +20,18 @@
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
#include "util.h"
+/* In case we do not have stdint.h and no other version of that
+ * conversion macro provide shortcut it. */
+#ifndef UINTMAX_C
+#define UINTMAX_C (c) (c)
+#endif
+
#define pass() do { ; } while(0)
#define fail(a) do { fprintf (stderr, "%s:%d: test %d failed\n",\
__FILE__,__LINE__, (a)); \
@@ -55,10 +64,10 @@ test_isotime2epoch (void)
{ "20070629T160000\n", 1183132800 },
{ "20070629T160000.", INVALID },
#if SIZEOF_TIME_T > 4
- { "21060207T062815", (time_t)0x0ffffffff },
- { "21060207T062816", (time_t)0x100000000 },
- { "21060207T062817", (time_t)0x100000001 },
- { "21060711T120001", (time_t)4308292801 },
+ { "21060207T062815", (time_t)UINTMAX_C(0x0ffffffff) },
+ { "21060207T062816", (time_t)UINTMAX_C(0x100000000) },
+ { "21060207T062817", (time_t)UINTMAX_C(0x100000001) },
+ { "21060711T120001", (time_t)UINTMAX_C(4308292801) },
#endif /*SIZEOF_TIME_T > 4*/
{ NULL, 0 }
};