From owner-freebsd-current Sun Mar 26 6: 1:22 2000 Delivered-To: freebsd-current@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 4073B37B76B for ; Sun, 26 Mar 2000 06:01:17 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.8.7/8.8.7) with ESMTP id AAA16073; Mon, 27 Mar 2000 00:08:26 +1000 Date: Mon, 27 Mar 2000 00:00:33 +1000 (EST) From: Bruce Evans X-Sender: bde@alphplex.bde.org To: Yoshinobu Inoue Cc: bmah@CA.Sandia.GOV, nnd@mail.nsk.ru, current@FreeBSD.ORG Subject: Re: 'machine/param.h' required for 'sys/socket.h' In-Reply-To: <20000326004417L.shin@nd.net.fujitsu.co.jp> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 > #else > #define _NO_NAME_SPACE_POLLUTION > #include > #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 is included is too ambitious. 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