Ethereal-dev: Re: [Ethereal-dev] Removal of unneeded includes

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxx>
Date: Tue, 9 Jul 2002 18:51:51 -0700
On Tue, Jul 09, 2002 at 03:19:34PM +0200, Joerg Mayer wrote:
> Also, if nobody complains, I'll remove netinet/in.h from as many
> files as possible

<netinet/in.h> is, I think, needed, on at least some platforms, to get
ntohs/ntohl/htons/htonl declared (or defined, on platforms where they're
do-nothing macros or otherwise inlined).

<sys/types.h> could perhaps be removed from more files if we got rid of
"u_char", "u_short", "u_int", and "u_long".  If, for a given item, all
that matters is the unsignedness of the type (and the reduction in the
number of characters in the name), "guchar", "gushort", "guint", and
"gulong" could be used; if a precise size in bytes is desired, "guint8",
"guint16", and "guint32" can be used.

(That might also remove the need to include <winsock2.h> in many cases.)