Add:core:Added simplified version of gettimeofday to MSVC build. (needed to build...
authorrikky <rikky@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Thu, 3 Mar 2011 15:54:34 +0000 (15:54 +0000)
committerrikky <rikky@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Thu, 3 Mar 2011 15:54:34 +0000 (15:54 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4292 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/util.c
navit/navit/util.h

index 66b50a4..2431587 100644 (file)
@@ -267,6 +267,17 @@ char * newSysString(const char *toconvert)
 #endif
 #endif
 
+#ifdef _MSC_VER
+int gettimeofday(struct timeval *time, void *local)
+{
+  int milliseconds = GetTickCount();
+
+  time->tv_sec = milliseconds/1000;
+  time->tv_usec = (milliseconds - (time->tv_sec * 1000)) * 1000;
+
+  return 0;
+}
+#endif
 /**
  * Convert an ISO 8601-style time string into epoch time.
  *
index bdd6144..73838b8 100644 (file)
@@ -36,5 +36,14 @@ char * newSysString(const char *toconvert);
 #endif
 unsigned int iso8601_to_secs(char *iso8601);
 char * current_to_iso8601(void);
+
+#ifdef _MSC_VER
+
+#include <winsock.h>
+
+int gettimeofday(struct timeval *time, void *);
+
+#endif
+
 #endif