Re: [Libevent-users] structure redefinition in _libevent_time.h and winsock2.h
Hi, Yes, you are right, most of the files are not for Windows. But I think the change for event.c is still necessary. That error might happen if you include winsock2.h before loading libevent in a project. I didn't try it under MinGW or Cygwin, but with Visual Studio, but I think they might have the same problem. Regards, Shiqing Nick Mathewson wrote: On Fri, Feb 5, 2010 at 10:30 AM, Shiqing Fan f...@hlrs.de wrote: Hi, When using libevent 1.4.13 in another project on Windows, we found some structure are redefined in _libevent_time.h and winsock2.h, for example 'struct timeval'. I made a patch to solve this problem, but I'm not sure if it's correct to exclude _libevent_time.h on Windows. Something fishy is going on here. For one thing, most of the files you changed should never actually get built for windows: devpoll.c, poll.c, kqueue.c, and epoll.c all refer to backend mechanisms that don't exist on windows. Other than that, I'm trying to reproduce the bug, but I'm not having much success. For me, 1.4.13 builds fine on Windows under mingw, and the current 1.4.x development version in git version builds fine on Windows under mingw, or with VC++ and nmake. Since you patched configure, I'm guessing you're on some version of mingw or maybe cygwin? If so, which version? ___ Libevent-users mailing list Libevent-users@monkey.org http://lists.monkey.org:8080/listinfo/libevent-users -- -- Shiqing Fan http://www.hlrs.de/people/fan High Performance Computing Tel.: +49 711 685 87234 Center Stuttgart (HLRS)Fax.: +49 711 685 65832 Address:Allmandring 30 email: f...@hlrs.de 70569 Stuttgart ___ Libevent-users mailing list Libevent-users@monkey.org http://lists.monkey.org:8080/listinfo/libevent-users
Re: [Libevent-users] structure redefinition in _libevent_time.h and winsock2.h
On Fri, Feb 5, 2010 at 10:30 AM, Shiqing Fan f...@hlrs.de wrote: Hi, When using libevent 1.4.13 in another project on Windows, we found some structure are redefined in _libevent_time.h and winsock2.h, for example 'struct timeval'. I made a patch to solve this problem, but I'm not sure if it's correct to exclude _libevent_time.h on Windows. Something fishy is going on here. For one thing, most of the files you changed should never actually get built for windows: devpoll.c, poll.c, kqueue.c, and epoll.c all refer to backend mechanisms that don't exist on windows. Other than that, I'm trying to reproduce the bug, but I'm not having much success. For me, 1.4.13 builds fine on Windows under mingw, and the current 1.4.x development version in git version builds fine on Windows under mingw, or with VC++ and nmake. Since you patched configure, I'm guessing you're on some version of mingw or maybe cygwin? If so, which version? ___ Libevent-users mailing list Libevent-users@monkey.org http://lists.monkey.org:8080/listinfo/libevent-users
[Libevent-users] structure redefinition in _libevent_time.h and winsock2.h
Hi, When using libevent 1.4.13 in another project on Windows, we found some structure are redefined in _libevent_time.h and winsock2.h, for example 'struct timeval'. I made a patch to solve this problem, but I'm not sure if it's correct to exclude _libevent_time.h on Windows. Regards, Shiqing -- -- Shiqing Fan http://www.hlrs.de/people/fan High Performance Computing Tel.: +49 711 685 87234 Center Stuttgart (HLRS)Fax.: +49 711 685 65832 Address:Allmandring 30 email: f...@hlrs.de 70569 Stuttgart --- devpoll.orig.c 2010-02-05 15:48:17.37500 +0100 +++ devpoll.c 2010-02-05 15:50:10.390625000 +0100 @@ -33,7 +33,9 @@ #ifdef HAVE_SYS_TIME_H #include sys/time.h #else +# ifndef HAVE_WINSOCK2_H #include sys/_libevent_time.h +# endif #endif #include sys/queue.h #include sys/devpoll.h --- poll.orig.c 2010-02-05 15:49:03.84375 +0100 +++ poll.c 2010-02-05 15:52:03.28125 +0100 @@ -34,7 +34,9 @@ #ifdef HAVE_SYS_TIME_H #include sys/time.h #else +# ifndef HAVE_WINSOCK2_H #include sys/_libevent_time.h +# endif #endif #include sys/queue.h #include poll.h --- event.orig.c2010-02-05 15:48:41.25000 +0100 +++ event.c 2010-02-05 15:54:55.890625000 +0100 @@ -36,8 +36,10 @@ #include sys/types.h #ifdef HAVE_SYS_TIME_H #include sys/time.h -#else +#else +# ifndef HAVE_WINSOCK2_H #include sys/_libevent_time.h +# endif #endif #include sys/queue.h #include stdio.h --- kqueue.orig.c 2010-02-05 15:48:51.46875 +0100 +++ kqueue.c2010-02-05 15:54:53.703125000 +0100 @@ -36,7 +36,9 @@ #ifdef HAVE_SYS_TIME_H #include sys/time.h #else +# ifndef HAVE_WINSOCK2_H #include sys/_libevent_time.h +# endif #endif #include sys/queue.h #include sys/event.h --- epoll.orig.c2010-02-05 15:48:30.34375 +0100 +++ epoll.c 2010-02-05 15:50:54.546875000 +0100 @@ -34,7 +34,9 @@ #ifdef HAVE_SYS_TIME_H #include sys/time.h #else +# ifndef HAVE_WINSOCK2_H #include sys/_libevent_time.h +# endif #endif #include sys/queue.h #include sys/epoll.h --- log.orig.c 2010-02-05 15:48:57.609375000 +0100 +++ log.c 2010-02-05 15:51:47.359375000 +0100 @@ -50,7 +50,9 @@ #ifdef HAVE_SYS_TIME_H #include sys/time.h #else +# ifndef HAVE_WINSOCK2_H #include sys/_libevent_time.h +# endif #endif #include stdio.h #include stdlib.h --- select.orig.c 2010-02-05 15:49:10.53125 +0100 +++ select.c2010-02-05 15:52:15.28125 +0100 @@ -34,7 +34,9 @@ #ifdef HAVE_SYS_TIME_H #include sys/time.h #else +# ifndef HAVE_WINSOCK2_H #include sys/_libevent_time.h +# endif #endif #ifdef HAVE_SYS_SELECT_H #include sys/select.h --- configure.orig 2010-02-05 16:15:26.21875 +0100 +++ configure 2010-02-05 16:15:31.171875000 +0100 @@ -20478,7 +20478,7 @@ -for ac_header in fcntl.h stdarg.h inttypes.h stdint.h poll.h signal.h unistd.h sys/epoll.h sys/time.h sys/queue.h sys/event.h sys/param.h sys/ioctl.h sys/select.h sys/devpoll.h port.h netinet/in6.h sys/socket.h +for ac_header in fcntl.h stdarg.h inttypes.h stdint.h poll.h signal.h unistd.h sys/epoll.h sys/time.h sys/queue.h sys/event.h sys/param.h sys/ioctl.h sys/select.h sys/devpoll.h port.h netinet/in6.h sys/socket.h winsock2.h do as_ac_Header=`$as_echo ac_cv_header_$ac_header | $as_tr_sh` if { as_var=$as_ac_Header; eval test \\${$as_var+set}\ = set; }; then ___ Libevent-users mailing list Libevent-users@monkey.org http://lists.monkey.org:8080/listinfo/libevent-users