[Libevent-users] [Patch] Install autoconf header file as evconfig.h

Dave Gotwisner dgotwisner at rosum.com
Fri Feb 16 20:31:40 EST 2007


William Ahern wrote:

>On Fri, Feb 16, 2007 at 04:58:53PM -0800, Dave Gotwisner wrote:
>  
>
>>Yes, C doesn't define it (ANSI should have at the char/short/long/long 
>>long level).  Even though there is nothing requiring that short is 16 
>>and long is 32, the fact that the type.h files I mentioned in my 
>>previous post imply that they really are required to be these sizes, or 
>>the header files be broke.
>>    
>>
>
>But C *does* define fixed-width types, through stdint.h, ever since C99
>(going on 8 years, now!). And all modern platforms which even contemplate
>some POSIX/SUSv3 support, provide stdint.h, now, w/ the glaring exception of
>Microsoft and the Visual Studio suite.
>
>Actually, I think that SUSv3 mandates uint8_t, uint16_t, uint32_t, similar
>to how POSIX/SUS mandates that CHAR_BIT is 8. C99, strictly speaking, only
>requires the fixed-width types be defined through stdint.h if they can be
>represented as such. C99 also defines least and fast types. In any event, it
>kills me that Microsoft won't even add stdint.h. Kills me!
>
>People rail against C99 all the time, but the fact is that some very
>important parts are very nearly universally supported, now, at least in
>terms of number of distinct enviornments. stdint.h and snprintf() are the
>two most widely known.
>
>  
>
I didn't anticipate that this would go for this long, but...

I agree stdint.h is pretty much a standard.  It defines the ones you are 
mentioning.  Libevent uses the u_intX_t types (from types.h).  As I 
said, my complaint is in the massive proliferation of these (in many 
different flavors).  In my opinion, C99 (and ANSI) should have specified 
it at the compiler level NOT the header level, but, oh well.  I would 
much rather see everything get broken by removing the different types 
from types.h than give everyone every flavor of everything, and then 
have companies specify their own standard definitions as well.

As for Microsoft not providing stdint.h, there is lots more that they 
provide or not that forces non-standard implementations (such as their 
template library for C++).

Enough said, lets get back to libevent rather than C.


More information about the Libevent-users mailing list