summaryrefslogtreecommitdiff
path: root/sysdep
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2017-05-16 14:18:25 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2017-05-16 14:56:01 +0200
commit1c5b4c5d5b937fe6bbc3a599296e40a05f022b33 (patch)
tree485b23852778fce1320dc9cf4c5180cdbf6be788 /sysdep
parentfd1f355b7b24f354f7d57f127911b4fd98354b34 (diff)
parentb845ea097c285f17641d60df3dea4d3e820a1475 (diff)
Merge branch 'master' into int-new
Diffstat (limited to 'sysdep')
-rw-r--r--sysdep/config.h1
-rw-r--r--sysdep/unix/timer.h16
2 files changed, 8 insertions, 9 deletions
diff --git a/sysdep/config.h b/sysdep/config.h
index d740ff06..fb710d86 100644
--- a/sysdep/config.h
+++ b/sysdep/config.h
@@ -24,6 +24,7 @@
#include "sysdep/paths.h"
/* Types */
+
#include <stdint.h>
typedef int8_t s8;
typedef uint8_t u8;
diff --git a/sysdep/unix/timer.h b/sysdep/unix/timer.h
index 99d43932..ae5a27e8 100644
--- a/sysdep/unix/timer.h
+++ b/sysdep/unix/timer.h
@@ -77,14 +77,12 @@ bird_clock_t tm_parse_datetime(char *); /* Convert date to bird_clock_t */
void
tm_format_datetime(char *x, struct timeformat *fmt_spec, bird_clock_t t);
-#ifdef TIME_T_IS_64BIT
-#define TIME_INFINITY 0x7fffffffffffffff
-#else
-#ifdef TIME_T_IS_SIGNED
-#define TIME_INFINITY 0x7fffffff
-#else
-#define TIME_INFINITY 0xffffffff
-#endif
-#endif
+#define TIME_T_IS_64BIT (sizeof(time_t) == 8)
+#define TIME_T_IS_SIGNED ((time_t) -1 < 0)
+
+#define TIME_INFINITY \
+ ((time_t) (TIME_T_IS_SIGNED ? \
+ (TIME_T_IS_64BIT ? 0x7fffffffffffffff : 0x7fffffff): \
+ (TIME_T_IS_64BIT ? 0xffffffffffffffff : 0xffffffff)))
#endif