Donate Share

libssh2

Tracker: Bugs

5 Visual Studio C++ doesn't have gettimeofday() - ID: 2865001
Last Update: Settings changed ( bagder )

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) .


Nobody/Anonymous ( nobody ) - 2009-09-23 13:28

5

Closed

Fixed

Daniel Stenberg

misc

None

Public


Comments ( 5 )

Date: 2009-09-23 16:23
Sender: bagderProject AdminAccepting Donations

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


Date: 2009-09-23 13:56
Sender: roadrunnAccepting Donations

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


Date: 2009-09-23 13:48
Sender: nobody

Note that timeGetTime() needs Winmm.lib.



Date: 2009-09-23 13:45
Sender: em1

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;
}



Date: 2009-09-23 13:28
Sender: nobody

This is version 1.2 of libssh2.


Attached File

No Files Currently Attached

Changes ( 5 )

Field Old Value Date By
status_id Open 2009-09-23 16:23 bagder
resolution_id None 2009-09-23 16:23 bagder
assigned_to nobody 2009-09-23 16:23 bagder
allow_comments 1 2009-09-23 16:23 bagder
close_date - 2009-09-23 16:23 bagder