From owner-freebsd-current Tue Mar 28 7:30:51 2000 Delivered-To: freebsd-current@freebsd.org Received: from fgwmail5.fujitsu.co.jp (fgwmail5.fujitsu.co.jp [192.51.44.35]) by hub.freebsd.org (Postfix) with ESMTP id 2A16437BF8A for ; Tue, 28 Mar 2000 07:30:42 -0800 (PST) (envelope-from shin@nd.net.fujitsu.co.jp) Received: from m3.gw.fujitsu.co.jp by fgwmail5.fujitsu.co.jp (8.9.3/3.7W-MX0002-Fujitsu Gateway) id AAA09136; Wed, 29 Mar 2000 00:29:56 +0900 (JST) (envelope-from shin@nd.net.fujitsu.co.jp) Received: from incapgw.fujitsu.co.jp by m3.gw.fujitsu.co.jp (8.9.3/3.7W-0003-Fujitsu Domain Master) id AAA11383; Wed, 29 Mar 2000 00:29:55 +0900 (JST) Received: from localhost ([192.168.245.131]) by incapgw.fujitsu.co.jp (8.9.3/3.7W-0002) id AAA06381; Wed, 29 Mar 2000 00:29:51 +0900 (JST) 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' In-Reply-To: References: <20000326004417L.shin@nd.net.fujitsu.co.jp> X-Mailer: Mew version 1.94 on Emacs 20.4 / Mule 4.0 (HANANOEN) X-Prom-Mew: Prom-Mew 1.93.4 (procmail reader for Mew) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Wed_Mar_29_00:30:47_2000_809)--" Content-Transfer-Encoding: 7bit Message-Id: <20000329003050L.shin@nd.net.fujitsu.co.jp> Date: Wed, 29 Mar 2000 00:30:50 +0900 From: Yoshinobu Inoue X-Dispatcher: imput version 990905(IM130) Lines: 221 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG ----Next_Part(Wed_Mar_29_00:30:47_2000_809)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit > > 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. I created the patches. It become a little bit more complicated than I expected, to avoid duplicated inclusion independently in each of namespace polluted part and non polluted part. Please give me comments if any. Thanks, Yoshinobu Inoue ----Next_Part(Wed_Mar_29_00:30:47_2000_809)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="namespace.diff" Index: sys/socket.h =================================================================== RCS file: /home/ncvs/src/sys/sys/socket.h,v retrieving revision 1.39 diff -u -r1.39 socket.h --- sys/socket.h 2000/03/11 19:51:04 1.39 +++ sys/socket.h 2000/03/28 12:02:12 @@ -37,6 +37,14 @@ #ifndef _SYS_SOCKET_H_ #define _SYS_SOCKET_H_ +#ifdef _NO_NAMESPACE_POLLUTION +#include +#else +#define _NO_NAMESPACE_POLLUTION +#include +#undef _NO_NAMESPACE_POLLUTION +#endif + /* * Definitions related to sockets: types, address families, options. */ Index: i386/include/param.h =================================================================== RCS file: /home/ncvs/src/sys/i386/include/param.h,v retrieving revision 1.54 diff -u -r1.54 param.h --- i386/include/param.h 1999/12/11 10:54:06 1.54 +++ i386/include/param.h 2000/03/28 12:02:13 @@ -37,8 +37,16 @@ * $FreeBSD: src/sys/i386/include/param.h,v 1.54 1999/12/11 10:54:06 peter Exp $ */ -#ifndef _MACHINE_PARAM_H_ -#define _MACHINE_PARAM_H_ +#ifndef _MACHINE_PARAM_H_NO_NAMESPACE_POLLUTION +#define _MACHINE_PARAM_H_NO_NAMESPACE_POLLUTION + +/* + * Round p (pointer or byte index) up to a correctly-aligned value + * for all data types (int, long, ...). The result is unsigned int + * and must be cast to any desired pointer type. + */ +#define _ALIGNBYTES (sizeof(int) - 1) +#define _ALIGN(p) (((unsigned)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) /* * Machine dependent constants for Intel 386. @@ -46,12 +54,23 @@ #ifndef _MACHINE #define _MACHINE i386 #endif -#ifndef MACHINE -#define MACHINE "i386" -#endif #ifndef _MACHINE_ARCH #define _MACHINE_ARCH i386 #endif + +#endif /* !_MACHINE_PARAM_H_NO_NAMESPACE_POLLUTION */ + +#ifndef _NO_NAMESPACE_POLLUTION + +#ifndef _MACHINE_PARAM_H_ +#define _MACHINE_PARAM_H_ + +/* + * Machine dependent constants for Intel 386. + */ +#ifndef MACHINE +#define MACHINE "i386" +#endif #ifndef MACHINE_ARCH #define MACHINE_ARCH "i386" #endif @@ -70,13 +89,8 @@ #define NCPUS 1 #endif -/* - * Round p (pointer or byte index) up to a correctly-aligned value - * for all data types (int, long, ...). The result is unsigned int - * and must be cast to any desired pointer type. - */ -#define ALIGNBYTES (sizeof(int) - 1) -#define ALIGN(p) (((unsigned)(p) + ALIGNBYTES) & ~ALIGNBYTES) +#define ALIGNBYTES _ALIGNBYTES +#define ALIGN(p) _ALIGN(p) #define PAGE_SHIFT 12 /* LOG2(PAGE_SIZE) */ #define PAGE_SIZE (1<