select: use correct SIZEOF_ constant
authorMarcel Raad <raad@teamviewer.com>
Mon, 27 Mar 2017 23:37:31 +0000 (01:37 +0200)
committerMarcel Raad <raad@teamviewer.com>
Thu, 30 Mar 2017 06:49:30 +0000 (08:49 +0200)
At least under Windows, there is no SIZEOF_LONG, so it evaluates to 0 even
though sizeof(int) == sizeof(long). This should probably have been
CURL_SIZEOF_LONG, but the type of timeout_ms changed from long to time_t
anyway.
This triggered MSVC warning C4668 about implicitly replacing undefined
macros with '0'.

Closes https://github.com/curl/curl/pull/1362

lib/select.c

index 14dc6e1348a2c469f49978622e039496d06ec635..f49314b3433a06ededb2aa9e4cb5c86d969efff8 100644 (file)
@@ -164,7 +164,7 @@ int Curl_socket_check(curl_socket_t readfd0, /* two sockets to read from */
   int r;
   int ret;
 
-#if SIZEOF_LONG != SIZEOF_INT
+#if SIZEOF_TIME_T != SIZEOF_INT
   /* wrap-around precaution */
   if(timeout_ms >= INT_MAX)
     timeout_ms = INT_MAX;