Subject: | Lib.xs fixup for win32 |
--- Lib.xs 2004-08-26 23:22:29.000000000 -0700
+++ Lib.xs.new 2004-08-27 06:27:27.875000000 -0700
@@ -1,11 +1,19 @@
+#include <event.h>
+#ifdef WIN32
+#undef read
+#undef write
+#else
+#include <sys/time.h>
+#endif
+
+
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
+
#include "ppport.h"
-#include <sys/time.h>
-#include <event.h>
#include "const-c.inc"
@@ -78,7 +86,13 @@
tv->tv_usec = (t - (long)t) * 1e6f;
}
-inline double delta_timeval (struct timeval *t1, struct timeval *t2) {
+#ifdef WIN32
+#define THEINLINE __forceinline
+#else
+#define THEINLINE inline
+#endif
+
+THEINLINE double delta_timeval (struct timeval *t1, struct timeval *t2) {
double t1t = t1->tv_sec + (double)t1->tv_usec / 1e6f;
double t2t = t2->tv_sec + (double)t2->tv_usec / 1e6f;
return t2t - t1t;