Bugs item #2865001, was opened at 2009-09-23 15:28
Message generated for change (Comment added) made by em1
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: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
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: 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