[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Make libevent work on win32.



Update of /home/or/cvsroot/libevent
In directory moria.mit.edu:/tmp/cvs-serv20971

Modified Files:
	event.c event.h 
Log Message:
Make libevent work on win32.

Index: event.c
===================================================================
RCS file: /home/or/cvsroot/libevent/event.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- event.c	22 Feb 2005 03:43:50 -0000	1.1
+++ event.c	22 Feb 2005 04:22:34 -0000	1.2
@@ -456,12 +456,7 @@
 
 	ev->ev_callback = callback;
 	ev->ev_arg = arg;
-#ifdef WIN32
-	ev->ev_fd = (HANDLE)fd;
-	ev->overlap.hEvent = ev;
-#else
-	ev->ev_fd = fd;
-#endif
+        ev->ev_fd = fd;
 	ev->ev_events = events;
 	ev->ev_flags = EVLIST_INIT;
 	ev->ev_ncalls = 0;

Index: event.h
===================================================================
RCS file: /home/or/cvsroot/libevent/event.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- event.h	22 Feb 2005 03:43:50 -0000	1.1
+++ event.h	22 Feb 2005 04:22:34 -0000	1.2
@@ -32,7 +32,12 @@
 #endif
 
 #ifdef WIN32
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+typedef unsigned char u_char;
+#undef __func__
+#define __func__ __FUNCTION__
 #endif
 
 #define EVLIST_TIMEOUT	0x01
@@ -79,12 +84,7 @@
 	RB_ENTRY (event) ev_timeout_node;
 
 	struct event_base *ev_base;
-#ifdef WIN32
-	HANDLE ev_fd;
-	OVERLAPPED overlap;
-#else
 	int ev_fd;
-#endif
 	short ev_events;
 	short ev_ncalls;
 	short *ev_pncalls;	/* Allows deletes in callback */