On Fri, Feb 16, 2007 at 04:10:03PM -0800, William Ahern wrote:
> On Fri, Feb 16, 2007 at 06:24:34PM -0500, Nick Mathewson wrote:
> > Hi, all!
> > 
> > Now that Libevent 1.3 is out, it's time for Patches Less Obvious.
> > 
> > One longstanding problems has been that it's not possible to include
> > event.h unless you first define u_int8_t, u_int32_t, struct timeval,
> > and so on.  It wasn't possible for event.h to do so itself, since the
> > info needed to decide whether to define those existed only in the
> > config.h file created by autoconf.
> > 
> > Here is a patch that solves this problem by renaming "config.h" to
> > "evconfig.h", making it get included from "event.h", and installing it
> > as a header file to $PREFIX/include.  This way, people on platforms
> > like mingw and Solaris will be able to build projects that use mingw
> > correctly.
> 
> Wouldn't it be cleaner to either
> 
> 1) Use (unsigned char) instead of (u_int8_t), (unsigned int) instead of
> (u_int32_t), and include <sys/time.h> or <timeb.h>, conditional on the
> WIN32 macro;

Actually, you'd want to do unsigned long instead of unsigned int; old C
only guarantees that int can hold 16 bits.

> or, if the above isn't portable enough from a theoretical perspective,
> 
> 2) Build an event.h using M4 and the autotools framework?
> 
> The additional header just litters things unneccesarily, especially for
> something this trivial (not to say the headaches are trivial; I build on all
> these platforms, too).

I think your approach is reasonable too in the medium term; you should
probably send a patch to the list too, so yours can win. :)

yrs,
-- 
Nick Mathewson

Attachment: pgp6LdQBu9T9V.pgp
Description: PGP signature

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

Reply via email to