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 [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to