From: Simson G. <si...@ac...> - 2011-02-16 23:27:19
|
> From: Tor Lillqvist <tm...@ik...> > Subject: Re: [Mingw-users] u_char and u_int > To: MinGW Users List <min...@li...> > Message-ID: > <AANLkTim7_w=7fw...@ma...> > Content-Type: text/plain; charset=UTF-8 > >> I understand that u_char and u_int are not defined as part of the mingw system or any of the include files. > > There are lots of compiler/OS combinations that don't have them, not > just MinGW. Don't fall into the trap thinking what whatever Linux and > glibc do is "the standard". > >> Is there a preferred way to get the typedef for u_char in programs that need to compile on both mingw and linux? > > No, it is a matter of taste, and it also depends on whether the > software uses an autoconf configure script or just ad-hoc ifdefs. > > The preferred way should probably be to just use <stdint.h> and > uint8_t. (And then, if you want to be portable to toolchains that lack > <stdint.h>, like MSVC <= 9.0, provide typedefs for them.) Wow! I wasn't aware of this issue. I guess "char" lives on but it's now "uint8_t" instead of "u_char" for me. It's so much easier to type and read... Thanks! |