r3223 - trunk/libmutil/source

erik at minisip.org erik at minisip.org
Tue Feb 27 00:43:50 CET 2007


Author: erik
Date: 2007-02-27 00:43:49 +0100 (Tue, 27 Feb 2007)
New Revision: 3223

Modified:
   trunk/libmutil/source/mtimeWin32.cxx
Log:

 * Compile/bug fix for mingw32 and vs8: I don't think we can send in a 
  struct timeb to both the the 32 and 64 bit ftime functions.



Modified: trunk/libmutil/source/mtimeWin32.cxx
===================================================================
--- trunk/libmutil/source/mtimeWin32.cxx	2007-02-26 22:22:01 UTC (rev 3222)
+++ trunk/libmutil/source/mtimeWin32.cxx	2007-02-26 23:43:49 UTC (rev 3223)
@@ -32,21 +32,18 @@
 #include <winsock2.h>
 
 
-static mutil_ftime( struct timeb *tb ){
+LIBMUTIL_API uint64_t mtime(){
 #ifdef _WIN32_WCE
-		_ftime (&tb);
+	struct _timeb tb;
+	_ftime (&tb);
 #elif defined(__MINGW32__)
-		_ftime64 (&tb);
+	struct __timeb64 tb;
+	_ftime64 (&tb);
 #else
-		_ftime64_s (&tb);
+	struct __timeb64 tb;
+	_ftime64_s (&tb);
 #endif
 
-}
-
-LIBMUTIL_API uint64_t mtime(){
-		struct timeb tb;
-		mutil_ftime (&tb);
-
 	return ((uint64_t)tb.time) * (int64_t)1000 + ((uint64_t)tb.millitm);
 }
 
@@ -54,8 +51,16 @@
 extern "C" {
 LIBMUTIL_API
 	void gettimeofday (struct timeval *tv, struct timezone *tz){
-		struct timeb tb;
-		mutil_ftime (&tb);
+#ifdef _WIN32_WCE
+		struct _timeb tb;
+		_ftime (&tb);
+#elif defined(__MINGW32__)
+		struct __timeb64 tb;
+		_ftime64 (&tb);
+#else
+		struct __timeb64 tb;
+		_ftime64_s (&tb);
+#endif
 
 		tv->tv_sec = (long)tb.time; // Fix: tv_sec wraps year 2038 (tv.time is ok though)
 		tv->tv_usec = tb.millitm * 1000L;



More information about the Minisip-devel mailing list