Fix:build:Enable replacement gettimeofday for old ming32/mingw32ce versions
authorrikky <rikky@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 9 Mar 2011 21:12:40 +0000 (21:12 +0000)
committerrikky <rikky@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 9 Mar 2011 21:12:40 +0000 (21:12 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4321 ffa7fe5e-494d-0410-b361-a75ebd5db220

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

index 2431587..b5a94ec 100644 (file)
@@ -267,7 +267,11 @@ char * newSysString(const char *toconvert)
 #endif
 #endif
 
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || (!defined(HAVE_GETTIMEOFDAY) && defined(HAVE_API_WIN32_BASE))
+/**
+ * Impements a simple incomplete version of gettimeofday. Only usefull for messuring
+ * time spans, not the real time of day.
+ */
 int gettimeofday(struct timeval *time, void *local)
 {
   int milliseconds = GetTickCount();
index 73838b8..f396060 100644 (file)
@@ -21,6 +21,7 @@
 #define NAVIT_types_H
 
 #include <ctype.h>
+#include "config.h"
 
 void strtoupper(char *dest, const char *src);
 void strtolower(char *dest, const char *src);
@@ -37,7 +38,7 @@ char * newSysString(const char *toconvert);
 unsigned int iso8601_to_secs(char *iso8601);
 char * current_to_iso8601(void);
 
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || (!defined(HAVE_GETTIMEOFDAY) && defined(HAVE_API_WIN32_BASE))
 
 #include <winsock.h>