summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-12-15 12:57:57 -0500
committerNick Mathewson <nickm@torproject.org>2015-12-15 12:57:57 -0500
commita7d44731d9ac831cd68f34ac640b50cdde3a60af (patch)
tree88a149ac07f30c0af5be47cc7d8f9ed9d57db244 /src/common
parent54433993c7c84dc9af878ebaf8dd1deae8c595e3 (diff)
parentd72af1085a1d9ed6f2c9bdb5e9c85eba991db842 (diff)
downloadtor-a7d44731d9ac831cd68f34ac640b50cdde3a60af.tar.gz
tor-a7d44731d9ac831cd68f34ac640b50cdde3a60af.zip
Merge remote-tracking branch 'teor/feature4483-v10-squashed'
Diffstat (limited to 'src/common')
-rw-r--r--src/common/torint.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/common/torint.h b/src/common/torint.h
index 6171700898..418fe0fabf 100644
--- a/src/common/torint.h
+++ b/src/common/torint.h
@@ -336,6 +336,32 @@ typedef uint32_t uintptr_t;
#endif /* time_t_is_signed */
#endif /* ifndef(TIME_MAX) */
+#ifndef TIME_MIN
+
+#ifdef TIME_T_IS_SIGNED
+
+#if (SIZEOF_TIME_T == SIZEOF_INT)
+#define TIME_MIN ((time_t)INT_MIN)
+#elif (SIZEOF_TIME_T == SIZEOF_LONG)
+#define TIME_MIN ((time_t)LONG_MIN)
+#elif (SIZEOF_TIME_T == 8)
+#define TIME_MIN ((time_t)INT64_MIN)
+#else
+#error "Can't define (signed) TIME_MIN"
+#endif
+
+#else
+/* Unsigned case */
+#if (SIZEOF_TIME_T == 4)
+#define TIME_MIN ((time_t)UINT32_MIN)
+#elif (SIZEOF_TIME_T == 8)
+#define TIME_MIN ((time_t)UINT64_MIN)
+#else
+#error "Can't define (unsigned) TIME_MIN"
+#endif
+#endif /* time_t_is_signed */
+#endif /* ifndef(TIME_MIN) */
+
#ifndef SIZE_MAX
#if (SIZEOF_SIZE_T == 4)
#define SIZE_MAX UINT32_MAX