Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Feb 1997 20:22:10 -0500 (EST)
From:      Thomas David Rivers <ponds!rivers@dg-rtp.dg.com>
To:        ponds!FreeBSD.ORG!hackers, ponds!NUXI.com!obrien
Subject:   Re: conditionally including <sys/param.h>
Message-ID:  <199702030122.UAA18377@lakes.water.net>

next in thread | raw e-mail | index | archive | help
> 
> Sorry to have to bring this back to light...
> I was under the impression that we had agreed that
> "#if (defined(__unix__) || defined(unix))" was the best way to
> conditionally include <sys/param.h>.  However, this email from Chuck,
> implies that this is a Bad Thing.

Unfortunately the symbols:
	unix
	FreeBSD
	NetBSD
	OpenBSD

violate the user's name space.  For example, I have programs
that define some of these on the command line.  If these were defined
elsewhere things would break.  [Of course, such things do break
on other hosts; e.g. SunOS 4.x defines "unix".]

I would suggest using:
	__unix__
	__FreeBSD__
	__NetBSD__
	__OpenBSD__

as identifiers beginning with "_" are reserved (per ANSI) for the
implementation.

	- Dave Rivers -


> 
> So to re-hash this, what does the list think is the best way to have an
> easy way to include <sys/param.h>?  Even thought I don't have all the
> *BSD folks in my grips like I did at USENIX, I'm still not above trying
> to get a new cpp symbol added (like __44bsd__ or something).
> 
> Chuck Robey writes:
> > > obrien      97/01/27 17:43:23
> > >   Modified:    share/doc/handbook  porting.sgml
> > >   Document the "#if (defined(__unix__) || defined(unix))" way of including
> > >   sys/param.h.  Change _HAVE_PARAM_H to "HAVE_SYS_PARAM_H" for those who
> > >   still like this method -- leading underscores are in the compiler/library
> > >   name space and the Ollivier says to follow GNU Autoconf anyway.
> > 
> > That test is completely bogus, cause it passes for all sysv systems,
> > which _don't_ have sys/param.h.  It's a completely useless test, and
> > someone justified it by saying that "most systems have a sys/param.h
> > anyhow".
> > 
> > What (in my own opinion) should have been done is to detect:
> > 
> > #ifdef FreeBSD || NetBSD || OpenBSD
> > 
> > that would have worked for those variants.  Would be able to find out the
> > one for BSDi systems, then we'd have a great deal of the important ones.
> > That's how X11R6 does it.
> 
> -- 
> -- David	(obrien@NUXI.com  -or-  obrien@FreeBSD.org)
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702030122.UAA18377>