Date: Sun, 26 Mar 2000 00:44:17 +0900 From: Yoshinobu Inoue <shin@nd.net.fujitsu.co.jp> To: bde@zeta.org.au Cc: bmah@CA.Sandia.GOV, nnd@mail.nsk.ru, current@FreeBSD.ORG Subject: Re: 'machine/param.h' required for 'sys/socket.h' Message-ID: <20000326004417L.shin@nd.net.fujitsu.co.jp> In-Reply-To: <Pine.BSF.4.21.0003252304180.815-100000@alphplex.bde.org> References: <20000325202906C.shin@nd.net.fujitsu.co.jp> <Pine.BSF.4.21.0003252304180.815-100000@alphplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> > > Instead, CMSG* should use _ALIGN() and _ALIGN() should be implemented > > > somewhere that doesn't add any namespace pollution. We currently > > > use <machine/ansi.h> for things like this, but it is already too > > > overloaded. > > > OK, then how about creating machine/align.h? > > That approach in general would give too many headers. > > <machine/ansi.h> is more wrongly loaded than overloaded. It is used > to avoid certain namespace problems in general, not just ones in ANSI > headers. It is mainly used to avoid namespace problems with typedefs. > Typedefs should all be handled in <machine/types.h>, but currently > aren't because <machine/types.h> would give namespace pollution in > ANSI headers. I think headers like <machine/param.h> and <machine/types.h> > should define only names in the implementation namespace, so that they > can be used in standard headers. The standard headers then export > precisely the names specified by the applicable standard, if any. Then, how about defining a macro which specifies name space polluted part, for short term solution. machine/param.h: #ifdef _NO_NAME_SPACE_POLLUTION #define _ALIGN(x) ...... .... #else .... #endif sys/socket.h: #ifdef _NO_NAME_SPACE_POLLUTION #include <machine/param.h> #else #define _NO_NAME_SPACE_POLLUTION #include <machine/param.h> #undef _NO_NAME_SPACE_POLLUTION #endif The macro might be also handy for fixing each of apps which depends on current machine/param.h and machine/types.h one by one. It can be specified for each apps, each dir, or in make.conf. When all apps are fixed, then the macro and name space polluted part in machine/param.h and machine/types.h can be removed. Or am I still too optimistic? Yoshinobu Inoue To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000326004417L.shin>