Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Jul 2003 13:37:04 -0400
From:      Garance A Drosihn <drosih@rpi.edu>
To:        obrien@FreeBSD.org, Bruce Evans <bde@zeta.org.au>
Cc:        Philippe Charnier <charnier@FreeBSD.org>
Subject:   Re: cvs commit: src/usr.sbin/lpr/lpd lpd.c ...
Message-ID:  <p05210652bb2f55fc4c53@[128.113.24.47]>
In-Reply-To: <20030707040326.GB26228@dragon.nuxi.com>
References:  <200307061244.h66CiBqg079835@repoman.freebsd.org> <p0521064ebb2e5c8dd5e7@[128.113.24.47]> <20030707003216.GI72093@elvis.mu.org> <p05210650bb2e737f369a@[128.113.24.47]> <20030707040326.GB26228@dragon.nuxi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
At 9:03 PM -0700 7/6/03, David O'Brien wrote:
>On Sun, Jul 06, 2003, Garance A Drosihn wrote:
>  > Well, any change to use __FBSDID() has to #include <sys/cdefs.h>
>>  to get FBSDID() to work.  Of course, /usr/include/sys/cdefs.h
>>  does not exist on all platforms either (and is certainly not
>>  likely to define __FBSDID even if the file does exist), so that's
>>  just more of an annoyance when I'm doing cross-platform work.
>
>#ifdef __FreeBSD__
>#include <sys/cdefs.h>
>__FBSDID("$FreeBSD$");
>#endif

I'm willing to go with the above for the sources in lpr if it
is reasonable to everyone.  It's not quite what I want, but I
probably should do something along these lines.

Actually, let me take that a step further. How about I change
all the source files to have:

#include "lpr_cdefs.h"
__FBSDID("$FreeBSD$");

And then add lpr/common_source/lpr_cdefs.h as:

#if !defined(__FreeBSD__)
#include <sys/cdefs.h>
#endif

#if !defined(__FBSDID)
#  if !defined(lint) && !defined(STRIP_FBSDID)
#    define __FBSDID(s)	rcsid[] = s
#  else
#    define __FBSDID(s)	struct skip_rcsid_hack
#  endif
#endif

(note that I sometimes still compile lpr on an older release
of freebsd, old enough that it does not have __FBSDID in it)

That's probably a little ugly, but I could use it to get all of
lpr using __FBSDID() so other developers will not feel tempted
to add it "for me".  And, all the ugliness is off in the one
lpr_cdefs.h file.  The nice thing about this for me is that
I *might* even be able to use the "#ident" directive when
compiling under IRIX, and I'll only have to change one file to
do that.

Would people mind if I changed all of lpr to use something
along these lines?  The more I think about this, the more I
think I like it...

-- 
Garance Alistair Drosehn            =   gad@gilead.netel.rpi.edu
Senior Systems Programmer           or  gad@freebsd.org
Rensselaer Polytechnic Institute    or  drosih@rpi.edu



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