Bugs item #2865001, was opened at 2009-09-23 15:28
Message generated for change (Settings changed) made by bagder
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=703942&aid=2865001&group_id=125852

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: misc
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: Daniel Stenberg (bagder)
Summary: Visual Studio C++ doesn't have gettimeofday()

Initial Comment:
libssh2 cannot be compiled by Visual Studio C++ with LIBSSH2DEBUG defined as 
gettimeofday() is not supported by Visual Studio C++ ( (I tried 2003 and 200) .


----------------------------------------------------------------------

>Comment By: Daniel Stenberg (bagder)
Date: 2009-09-23 18:23

Message:
Exactly, this problem is already fixed in git. Case closed!

----------------------------------------------------------------------

Comment By: Neil Gierman (roadrunn)
Date: 2009-09-23 15:56

Message:
An alternative fix was checked into git 3 days ago and is in the git daily
snapshots from September 20th and later.

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2009-09-23 15:48

Message:
Note that timeGetTime() needs Winmm.lib.


----------------------------------------------------------------------

Comment By: Eberhard Mattes (em1)
Date: 2009-09-23 15:45

Message:
Here's a fix:

--- misc.c.orig 2009-05-14 17:00:34.000000000 +0200
+++ misc.c      2009-09-23 15:38:50.000000000 +0200
@@ -318,7 +318,12 @@
     char buffer[1536];
     int len;
     va_list vargs;
+#ifdef WIN32
+    struct { int tv_sec, tv_usec; } now;
+    DWORD t;
+#else
     struct timeval now;
+#endif
     static int firstsec;
     static const char *const contexts[9] = {
         "Unknown",
@@ -339,7 +344,13 @@
         /* no such output asked for */
         return;
     }
+#ifdef WIN32
+    t = timeGetTime ();
+    now.tv_sec = t / 1000;
+    now.tv_usec = (t % 1000) * 1000;
+#else
     gettimeofday(&now, NULL);
+#endif
     if(!firstsec) {
         firstsec = now.tv_sec;
     }


----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2009-09-23 15:28

Message:
This is version 1.2 of libssh2.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=703942&aid=2865001&group_id=125852
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Reply via email to