#221: getttimeofday namespace pollution in windows build
-------------------------+--------------------------------------------------
Reporter: billsegall | Owner:
Type: defect | Status: new
Priority: normal | Milestone: 1.2.9
Component: misc | Version: 1.2.8
Keywords: namespace | Blocks:
Blocked By: |
-------------------------+--------------------------------------------------
My project uses both libssh2 and net-snmp and I build both libraries
statically for Win32. Unfortunately, both define a getttimeofday symbol
which then conflicts when linking. The following patch to libssh2-1.2.28
fixes this by renaming getttimeofday on the Windows platform.
Thanks,
Bill.
--- misc.c.orig 2010-12-22 23:32:23.000000000 +1000
+++ misc.c 2011-08-03 10:29:46.666602903 +1000
@@ -418,7 +418,11 @@
}
}
+#if defined(LIBSSH2_WIN32) && !defined(__MINGW32__)
+ libssh2_gettimeofday(&now, NULL);
+#else
gettimeofday(&now, NULL);
+#endif
if(!firstsec) {
firstsec = now.tv_sec;
}
@@ -586,7 +590,7 @@
#define _W32_FT_OFFSET (116444736000000000)
-int __cdecl gettimeofday(struct timeval *tp,
+int __cdecl libssh2_gettimeofday(struct timeval *tp,
void *tzp)
{
union {
-- Ticket URL: <http://trac.libssh2.org/ticket/221> libssh2 <http://trac.libssh2.org/> C library for writing portable SSH2 clients _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-develReceived on 2011-08-04