Date: Mon, 27 Mar 2000 00:00:33 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: Yoshinobu Inoue <shin@nd.net.fujitsu.co.jp> Cc: bmah@CA.Sandia.GOV, nnd@mail.nsk.ru, current@FreeBSD.ORG Subject: Re: 'machine/param.h' required for 'sys/socket.h' Message-ID: <Pine.BSF.4.21.0003262249530.2515-100000@alphplex.bde.org> In-Reply-To: <20000326004417L.shin@nd.net.fujitsu.co.jp>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 26 Mar 2000, Yoshinobu Inoue wrote: > > > OK, then how about creating machine/align.h? > > > > That approach in general would give too many headers. > 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 NAME_SPACE should be spelled NAMESPACE. _ALIGN() can be defined unconditionally, since it is in the implementation namespace. This gives slightly simpler ifdefs and requires less duplication (define ALIGN(...) as _ALIGN(...)). > 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 I like this for a quick fix. Only define _ALIGN() like the current ALIGN(). Don't define all the variants given in your previous mail. > 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? Supporting _NO_NAME_SPACE_POLLUTION being defined when <sys/socket.h> is included is too ambitious. <sys/socket.h> doesn't actually support it. All headers would need to have ifdefs like the above ones for machine/param.h to support it in general. It would be simpler to make only certain leaf headers support it. Bruce 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?Pine.BSF.4.21.0003262249530.2515-100000>