summaryrefslogtreecommitdiff
path: root/WIN32-Code/misc.c
diff options
context:
space:
mode:
authorNiels Provos <provos@gmail.com>2006-09-27 03:18:45 +0000
committerNiels Provos <provos@gmail.com>2006-09-27 03:18:45 +0000
commit0f33fc5b84ccdd73f6c899a275c11053710682b1 (patch)
treec00787b3f0323394e656adb68e4b841f917a617c /WIN32-Code/misc.c
parentbe392175559cbf39ba906f2bc8ba49d2f9146f97 (diff)
downloadlibevent-patches-1.1.tar.gz
integrate from trunk: mingw support from Nickpatches-1.1
svn:r236
Diffstat (limited to 'WIN32-Code/misc.c')
-rw-r--r--WIN32-Code/misc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/WIN32-Code/misc.c b/WIN32-Code/misc.c
index 7329242b..6f63ddfe 100644
--- a/WIN32-Code/misc.c
+++ b/WIN32-Code/misc.c
@@ -4,6 +4,12 @@
#include <sys/timeb.h>
#include <time.h>
+#ifdef __GNUC__
+/*our prototypes for timeval and timezone are in here, just in case the above
+ headers don't have them*/
+#include "misc.h"
+#endif
+
/****************************************************************************
*
* Function: gettimeofday(struct timeval *, struct timezone *)
@@ -17,6 +23,7 @@
*
****************************************************************************/
+#ifndef HAVE_GETTIMEOFDAY
int gettimeofday(struct timeval *tv, struct timezone *tz) {
struct _timeb tb;
@@ -28,6 +35,7 @@ int gettimeofday(struct timeval *tv, struct timezone *tz) {
tv->tv_usec = ((int) tb.millitm) * 1000;
return 0;
}
+#endif
int
win_read(int fd, void *buf, unsigned int length)