aboutsummaryrefslogtreecommitdiff
path: root/lib/curl_setup.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-01-18 20:24:05 +0100
committerDaniel Stenberg <daniel@haxx.se>2018-01-25 22:20:52 +0100
commit1c39128d974666107fc6d9ea15f294036851f224 (patch)
treec3a81a69310c7561f6bec4336abc80d6afa6d3ca /lib/curl_setup.h
parent1433e4645b51a4ccb0b5e23a889ac9bd6093e3e2 (diff)
parsedate: fix date parsing for systems with 32 bit long
Make curl_getdate() handle dates before 1970 as well (returning negative values). Make test 517 test dates for 64 bit time_t. This fixes bug (3) mentioned in #2238 Closes #2250
Diffstat (limited to 'lib/curl_setup.h')
-rw-r--r--lib/curl_setup.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/curl_setup.h b/lib/curl_setup.h
index e5a657934..100b8d40f 100644
--- a/lib/curl_setup.h
+++ b/lib/curl_setup.h
@@ -424,6 +424,24 @@
#endif
#define CURL_OFF_T_MIN (-CURL_OFF_T_MAX - CURL_OFF_T_C(1))
+#if (SIZEOF_TIME_T == 4)
+# ifdef HAVE_TIME_T_UNSIGNED
+# define TIME_T_MAX UINT_MAX
+# define TIME_T_MIN 0
+# else
+# define TIME_T_MAX INT_MAX
+# define TIME_T_MIN INT_MIN
+# endif
+#else
+# ifdef HAVE_TIME_T_UNSIGNED
+# define TIME_T_MAX 0xFFFFFFFFFFFFFFFF
+# define TIME_T_MIN 0
+# else
+# define TIME_T_MAX 0x7FFFFFFFFFFFFFFF
+# define TIME_T_MIN -0x10000000000000000
+# endif
+#endif
+
/*
* Arg 2 type for gethostname in case it hasn't been defined in config file.
*/