On Mon, Dec 20, 2010 at 4:06 PM, Christian Ludwig <[email protected]> wrote: > I was playing around in the arch code of OpenBSD/i386 lately, and again > and again found that sys/user.h was not safe against multiple inclusions > from the same source file. Is that for a reason? One of my header files > needs to include sys/user.h, which creates a huge mess.
You have a header that needs the full struct user definition and can't make do with a forward declaration of it? (Note that the struct user definition is the _only_ correct reason to #include <sys/user.h>) This has been handled so far by simply including sys/user.h in each file that needs the header. For example, machine/freebsd_machdep.h would seem to need the struct user definition for its offsetof usage, but instead the one .c file that uses that header pulls it in. Philip Guenther
