Re: #include <netinet/tcp.h> and gcc -ansi
On Wed, Mar 31, 2004 at 02:58:53PM -0500, Eloy A. Paris wrote:
> When a program that #includes <netinet/tcp.h> is compiled with -ansi
> "struct tcphdr" is not defined. This is different from #including
> <netinet/ip.h> and <netinet/udp.h>, where both "struct iphdr" and
> "struct udphdr" are defined.
> The problem is that the definition for "struct tcphdr" in netinet/tcp.h
> is protected by a "#ifdef __MISC". What's the reason for this, and why
> it is not consistent with ip.h and udp.h?
> Any suggestions for portability?
Probably there's some standard which doesn't even mention
netinet/udp.h, but does mention what is in netinet/tcp.h. No, no
suggestions for portability; you could just add -D_BSD_SOURCE -ansi.
MontaVista Software Debian GNU/Linux Developer