gettimeofday: fix name space pollution

For systems without its own gettimeofday() implementation, we still must
not provide one outside our namespace.

Reported by: Bill Segall
This commit is contained in:
Daniel Stenberg
2011-08-05 23:46:12 +02:00
parent 49453c9ae2
commit 79f48e4881
3 changed files with 26 additions and 15 deletions

View File

@@ -424,7 +424,7 @@ _libssh2_debug(LIBSSH2_SESSION * session, int context, const char *format, ...)
}
}
gettimeofday(&now, NULL);
_libssh2_gettimeofday(&now, NULL);
if(!firstsec) {
firstsec = now.tv_sec;
}
@@ -563,16 +563,15 @@ void _libssh2_list_insert(struct list_node *after, /* insert before this */
#endif
#if defined(LIBSSH2_WIN32) && !defined(__MINGW32__)
/* this define is defined in misc.h for the correct platforms */
#ifdef LIBSSH2_GETTIMEOFDAY_WIN32
/*
* gettimeofday
* Implementation according to:
* The Open Group Base Specifications Issue 6
* IEEE Std 1003.1, 2004 Edition
*/
/*
* THIS SOFTWARE IS NOT COPYRIGHTED
*
@@ -591,9 +590,7 @@ void _libssh2_list_insert(struct list_node *after, /* insert before this */
/* Offset between 1/1/1601 and 1/1/1970 in 100 nanosec units */
#define _W32_FT_OFFSET (116444736000000000)
int __cdecl gettimeofday(struct timeval *tp,
void *tzp)
int __cdecl _libssh2_gettimeofday(struct timeval *tp, void *tzp)
{
union {
unsigned __int64 ns100; /*time since 1 Jan 1601 in 100ns units */