]> granicus.if.org Git - curl/commitdiff
configure: fix the check for unsigned time_t
authorDaniel Stenberg <daniel@haxx.se>
Thu, 25 Jan 2018 21:32:57 +0000 (22:32 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 25 Jan 2018 21:32:57 +0000 (22:32 +0100)
Assign the time_t variable negative value and then check if it is
greater than zero, which will evaluate true for unsigned time_t but
false for signed time_t.

configure.ac

index 76fa93d1baadd572fdfd5142345aa122142fbd06..d305e9693533ee0ecf2ca97bf690ff912f4e2c34 100755 (executable)
@@ -3488,7 +3488,7 @@ AC_RUN_IFELSE([
   AC_LANG_SOURCE([[
   #include <time.h>
   #include <limits.h>
-  time_t t = ULONG_MAX;
+  time_t t = -1;
   return (t > 0);
   ]])] ,[
   AC_MSG_RESULT([yes])