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

Reply via email to