Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 05 Sep 2001 20:38:37 -0700
From:      Peter Wemm <peter@wemm.org>
To:        Garance A Drosihn <drosih@rpi.edu>
Cc:        obrien@FreeBSD.org, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: macro recommendation (Was ...) 
Message-ID:  <20010906033837.32AEC380A@overcee.netplex.com.au>
In-Reply-To: <p0510100db7bc0a81c3f1@[128.113.24.47]> 

next in thread | previous in thread | raw e-mail | index | archive | help
Garance A Drosihn wrote:
> At 8:52 AM -0700 9/5/01, David O'Brien wrote:
> >Also, if you want a truely portable usage, we cannot use __RCSID()
> >because too much NetBSD and vendor sources use it.  Peter's hack
> >will not work for all compilers.  I would have prefered a __FBSD()
> >and __CSRG() macro for the same reasons we switched to $FreeBSD$
> >from $Id$.  These would have worked for all compilers, but I cannot
> >complete with an effort backed by Peter.
> 
> It seems reasonable to me that freebsd would use different macro
> names for freebsd-specific id's.  The issue isn't one that I feel
> strongly about, but I can see the advantage of using distinctive
> names.

If it wasn't for the fact that we'd have to add a #include to every header,
I'd like to have a special header tag.  We could turn it on for ELF, and off
for things that dont have strippable comment sections.

eg:
#ifdef __ELF__
#define __FBSDHDR(x) __IDSTRING(fbsdhdr, x)
#else
#define __FBSDHDR(x)
#endif
#define __FBSD(x) __IDSTRING(fbsd, x)

Then stdio.h etc could have one.

The problem would be that it would need something like this:

# cat stdio.h
#include <sys/cdefs.h>
__FBSDHDR("$FreeBSD$");
.. rest of stdio.h

Of course, we could move stuff to <rcsid.h>, but then we need to export things
like __CONCAT etc.  But on the other hand, large chunks of /usr/include
already *have* sys/cdefs.h for __BEGIN_DECLS() etc.

Cheers,
-Peter
--
Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au
"All of this is for nothing if we don't go to the stars" - JMS/B5


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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