From 53aafd689707299f18f51e7f4c8c7c3102ffefa0 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 10 Apr 2014 11:06:22 -0700 Subject: [PATCH] rely on winsock2 for timeval declaration --- libraries/shared/src/Systime.cpp | 5 ++--- libraries/shared/src/Systime.h | 26 ++------------------------ 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/libraries/shared/src/Systime.cpp b/libraries/shared/src/Systime.cpp index 7d8764e3f9..505703a7ee 100644 --- a/libraries/shared/src/Systime.cpp +++ b/libraries/shared/src/Systime.cpp @@ -1,14 +1,13 @@ #ifdef _WIN32 #include -#define _timeval_ #include "Systime.h" - int gettimeofday( timeval* p_tv, timezone* p_tz ) - { + int gettimeofday(timeval* p_tv, timezone* p_tz) { int tt = timeGetTime(); p_tv->tv_sec = tt / 1000; p_tv->tv_usec = tt % 1000 * 1000; return 0; } + #endif diff --git a/libraries/shared/src/Systime.h b/libraries/shared/src/Systime.h index 1d25de0b80..5d96b53e7a 100644 --- a/libraries/shared/src/Systime.h +++ b/libraries/shared/src/Systime.h @@ -1,38 +1,16 @@ #ifndef __Systime__ #define __Systime__ - #ifdef _WIN32 -#ifdef _WINSOCK2API_ -#define _timeval_ -#endif - -#ifndef _timeval_ -#define _timeval_ -/* - * Structure returned by gettimeofday(2) system call, - * and used in other calls. - */ - -// this is a bit of a hack for now, but sometimes on windows -// we need timeval defined here, sometimes we get it -// from winsock.h -#ifdef WANT_TIMEVAL -struct timeval { - long tv_sec; /* seconds */ - long tv_usec; /* and microseconds */ -}; -#endif - -#endif _timeval_ +#include struct timezone { int tz_minuteswest; /* minutes west of Greenwich */ int tz_dsttime; /* type of dst correction */ }; -int gettimeofday( struct timeval* p_tv, struct timezone* p_tz ); +int gettimeofday(struct timeval* p_tv, struct timezone* p_tz); #endif _Win32