Subject: Re: #include problem
To: None <port-sparc@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: port-sparc
Date: 12/29/2001 11:18:52
>>> When I try compile this "program":
[which begins with #include <sys/socket.h>]
>>> /usr/include/sys/socket.h:186: syntax error before `u_char'
>>> /usr/include/sys/socket.h:214: syntax error before `u_char'
>> You have to include <sys/types.h>
Surely the right thing to do is fix <sys/socket.h> so it includes
everything it needs? I've been gradually fixing such include-file bugs
as I trip over them; of 99 .h file patches in my private patch tree, 37
are just to add such missing includes. (Another 5 are to add
#ifndef/#define/#endif wrappers, and one does both. The remaining 56
have other changes, though many of those 56 also add missing
#includes.) I'm sure there are many left I haven't noticed; someday I
intend to do a sweep through /usr/include, compiling a file that
consists of a single #include for each of the files there. (I expect
to end up ignoring a ot of files like <machine/proc.h> that exist for
internal reasons and which should never be included directly.)
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML mouse@rodents.montreal.qc.ca
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B