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

Re: [Libevent-users] Patch for mingw64 (64-bit windows)



Hi Nick!

Nick Mathewson wrote:
On Fri, Dec 18, 2009 at 04:53:41PM -0500, Patrick Galbraith wrote:
 [...]
  
@@ -11,6 +11,6 @@
 Requires:
 Conflicts:
 Libs: -L${libdir} -levent
-Libs.private: 
+Libs.private: -lws2_32 
 Cflags: -I${includedir}
    

Hm.  Is there some way to do this conditionally?  We only want to link
against -lws2_32 when we're on Windows.


  
Hmm, I didn't mean to include this in the patch. I think this might even be auto-generated.

  
Only in libevent-2.0.3-alpha.win64: libtool
diff -ur libevent-2.0.3-alpha/log.c libevent-2.0.3-alpha.win64/log.c
--- libevent-2.0.3-alpha/log.c	2009-11-07 13:12:14 -0500
+++ libevent-2.0.3-alpha.win64/log.c	2009-12-11 17:55:27 -0500
@@ -101,7 +101,7 @@
 }
 
 void
-event_sock_err(int eval, evutil_socket_t sock, const char *fmt, ...)
+event_sock_err(int eval, int sock, const char *fmt, ...)
    

I've changed both instances to be evutil_socket_t (rather than int.)
Thanks!
  
I thought of doing that instead, also.

  
 {
 	va_list ap;
 	int err = evutil_socket_geterror(sock);
Only in libevent-2.0.3-alpha.win64/sample: Makefile
diff -ur libevent-2.0.3-alpha/select.c libevent-2.0.3-alpha.win64/select.c
--- libevent-2.0.3-alpha/select.c	2009-11-07 13:12:14 -0500
+++ libevent-2.0.3-alpha.win64/select.c	2009-12-11 18:07:06 -0500
@@ -168,7 +168,11 @@
 	event_debug(("%s: select reports %d", __func__, res));
 
 	check_selectop(sop);
+#ifndef WIN32
 	i = random() % (nfds+1);
+#else
+	i = rand() % (nfds+1);
+#endif
    

  
I didn't know this. I just take whatever running configure gives me. I think I have select() as part of mingw(). I had a problem with libmemcached using poll() so Trond wrote a wrapper that basically implemented poll() using select(), but I think the compilation used regular select vs. the windows select.

This is win2008, btw. Not sure if that helps.

I'm going to cc this email to the mingw-w64 list and see what their thoughts are. They are a very helpful group of people!

regards,

Patrick

Hang on, what's going on here?  select.c isn't even supposed to get
built on windows; it only works for a posix-style bitfield-based
select().  The windows version is in win32select.c (or
WIN32-Code/win32.c in older versions of Libevent).

Is there a problem in the build process that is making select.c get
built on mingw64?

yrs,
  

*********************************************************************** To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with unsubscribe libevent-users in the body.