make our private version of gettimeofday() static

This commit is contained in:
Daniel Stenberg 2004-01-04 12:10:14 +00:00
parent 93a8572928
commit a0edfb90c2

View File

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2003, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -28,8 +28,7 @@
#ifdef WIN32 #ifdef WIN32
#include <mmsystem.h> #include <mmsystem.h>
int static int gettimeofday(struct timeval *tp, void *nothing)
gettimeofday (struct timeval *tp, void *nothing)
{ {
#ifdef WITHOUT_MM_LIB #ifdef WITHOUT_MM_LIB
SYSTEMTIME st; SYSTEMTIME st;
@ -63,22 +62,25 @@ gettimeofday (struct timeval *tp, void *nothing)
Usec = (Ticks - (Sec*1000))*1000; Usec = (Ticks - (Sec*1000))*1000;
tp->tv_sec = Sec; tp->tv_sec = Sec;
tp->tv_usec = Usec; tp->tv_usec = Usec;
#endif #endif /* WITHOUT_MM_LIB */
return 1; return 0;
} }
#define HAVE_GETTIMEOFDAY #else /* WIN32 */
#endif /* non-win32 version of Curl_gettimeofday() */
#endif static int gettimeofday(struct timeval *tp, void *nothing)
{
(void)nothing; /* we don't support specific time-zones */
tp->tv_sec = (long)time(NULL);
tp->tv_usec = 0;
return 0;
}
#endif /* WIN32 */
#endif /* HAVE_GETTIMEOFDAY */
struct timeval Curl_tvnow (void) struct timeval Curl_tvnow (void)
{ {
struct timeval now; struct timeval now;
#ifdef HAVE_GETTIMEOFDAY (void)gettimeofday(&now, NULL);
gettimeofday (&now, NULL);
#else
now.tv_sec = (long) time(NULL);
now.tv_usec = 0;
#endif
return now; return now;
} }