On Fri, May 22, 2009 at 07:44:36PM +0100, James Mansion wrote:
> Nick Mathewson wrote:
 [...]
> >So reading that message again, I guess I wasn't as explicit as I
> >should have been.  Short version: "yes, I think the next release will
> >build okay with visual C.  But somebody besides me test out the code
> >in the subversion repository to make sure there aren't any surprises."
> >
> >yrs,
> >  
> 
> (Using: Visual Studio Express and Windows 7 SDK Beta, Vista Home Premium 
> 32 bit)
> 
> As of r1298.

Thanks!  I've fixed some of the stuff below, I hope.  See comments at
the bottom for some more stuff we should do that I will probably
need help with.

> -----------------
> 
> Build fails on ssize_t in args to evbuffer_reserve_space.
> 
> If I search for ssize_t then I can see:
> 
> #define _EVENT_ssize_t
> use of ssize_t
> use of SSIZE_T
> use of ev_ssize_t
> 
> I added:
> 
> #define ssize_t _EVENT_ssize_t
> 
> #define ev_ssize_t _EVENT_ssize_t

I've changed the code to use ev_ssize_t thoughout, which should be
defined in include/event2/util.h.

 [...]
> time-test.c does not compile because event2\event_struct.h
> uses struct timeval.h and WinSock.h has not been included.
> 
> I added:
> 
> #ifdef WIN32
> #include <winsock2.h>
> #include <windows.h>
> #include <io.h>
> #endif
> 
> to time-test.c, but the reality is that any file including
> event_struct.h will need to do this.  I suggest using a
> private type that is equivalent of including WinSock2.h
> into a base libevent header. This isn't likely to increase
> the dependencies of a Windows application that uses libevent.

"A private type"?  What kind of thing do you mean here?


> -----------------
> 
> signal-test.c and time-test.c use the C99 __func__.
> 
> I added:
> 
> #define __func__ __FUNCTION__
> 
> in a Win32-specific block - I'm lazy, its compiler-specific
> really.

Fixed in svn.

> -----------------
> 
> Execution fails:
> 
> C:\src\libevent\WIN32-Prj>time_test\debug\time_test
> [err] evsig_init: socketpair: Successful WSAStartup not yet performed 
> [WSANOTINITIALISED ]
> 
> C:\src\libevent\WIN32-Prj>signal_test\debug\signal_test.exe
> [err] evsig_init: socketpair: Successful WSAStartup not yet performed 
> [WSANOTINITIALISED ]

Fixed these two too.

> event_test fails the same way though I don't get an error
> message when running from the command line (I do under the debugger,
> which is odd).

It looks like event_test is just plain broken on Windows.  Whoever
wrote it seems to have been under the impression that CreateFile
would give you something you can pass to select(), which isn't so.

(Yeah, we totally need new example code.  If anybody wants to write
some, that would be wonderful.)

OTHER QUESTIONS:

Q1:

It sounds like you're winding up with project files that are better
than the ones we have.  Is that so?  Should we ship yours instead?

(I'd try to reproduce your changes, but I always screw up Visual
Studio stuff whenever I touch it, and wind up making changes only to
the debug build, or adding absolute paths by mistake, or stuff like
that.)

Q2:

Were you able to compile regress.exe in test?  That's the one with the
actual serious regression tests that let us know whether Libevent is
working.  I don't know if there's a project for it.  Its sources on
win32 should be:

  regress.c
  regress.gen.c
  regress.gen.h
  regress.h
  regress_buffer.c
  regress_bufferevent.c
  regress_dns.c
  regress_et.c
  regress_http.c
  regress_iocp.c
  regress_main.c
  regress_minheap.c
  [NOT INCLUDED ON WIN32: regress_pthread.c]
  regress_rpc.c
  regress_util.c
  [NOT INCLUDED ON WIN32: regress_zlib.c]
  tinytest.c
  tinytest.h
  tinytest_macros.h

Q3:

There are a bunch of other new files in Libevent 2.0 that may not be
in the old project files.  On win32, the libevent_core library should
contain:

  WIN32-Code/win32.c
  buffer.c
  buffer_iocp.c
  bufferevent.c
  bufferevent_async.c
  bufferevent_filter.c
  bufferevent_pair.c
  bufferevent_sock.c
  event.c
  event_iocp.c
  evmap.c
  evthread_win32.c
  evutil.c
  listener.c
  log.c
  strlcpy.c

and the libevent_extra library should contain:

  event_tagging.c
  http.c
  evdns.c
  evrpc.c

(The libevent library is for backward compatibility, and should
contain all of the above.)

If any of these sources are missing from the appropriate project
files, they should be added in.

yrs,
-- 
Nick
_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users

Reply via email to