Commit a0edfb90 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

make our private version of gettimeofday() static

parent 93a85729
Loading
Loading
Loading
Loading
+24 −22
Original line number Diff line number Diff line
@@ -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
 * you should have received as part of this distribution. The terms
@@ -28,8 +28,7 @@
#ifdef WIN32
#include <mmsystem.h>

int
gettimeofday (struct timeval *tp, void *nothing)
static int gettimeofday(struct timeval *tp, void *nothing)
{
#ifdef WITHOUT_MM_LIB
  SYSTEMTIME st;
@@ -63,22 +62,25 @@ gettimeofday (struct timeval *tp, void *nothing)
  Usec = (Ticks - (Sec*1000))*1000;
  tp->tv_sec = Sec;
  tp->tv_usec = Usec;
#endif
  return 1;
#endif /* WITHOUT_MM_LIB */
  return 0;
}
#define HAVE_GETTIMEOFDAY
#endif
#endif
#else /* WIN32 */
/* non-win32 version of Curl_gettimeofday() */
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 now;
#ifdef HAVE_GETTIMEOFDAY
 gettimeofday (&now, NULL);
#else
 now.tv_sec = (long) time(NULL);
 now.tv_usec = 0;
#endif
  (void)gettimeofday(&now, NULL);
  return now;
}