Skip to content

Commit

Permalink
On MINGW, don't redefine timezone and gettimeofday
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusroemer committed Aug 12, 2024
1 parent 5373397 commit 0be0697
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions utils/timeutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,19 @@
#include <sys/types.h>
#include <winsock.h>

struct timezone {
char dummy;
};

__inline void gettimeofday(struct timeval* t, void* timezone)
{
struct _timeb timebuffer;
_ftime( &timebuffer );
t->tv_sec=timebuffer.time;
t->tv_usec=1000*timebuffer.millitm;
}
#ifndef __MINGW32__
struct timezone {
char dummy;
};

__inline void gettimeofday(struct timeval* t, void* timezone)
{
struct _timeb timebuffer;
_ftime( &timebuffer );
t->tv_sec=timebuffer.time;
t->tv_usec=1000*timebuffer.millitm;
}
#endif /* __MINGW32__ */
#else /* UNIX */
#include <sys/time.h>
__inline void gettimeofday(struct timeval* t, void* timezone) {
Expand Down

0 comments on commit 0be0697

Please sign in to comment.