cvs commit: src/usr.sbin/lpr/lpd lpd.c ...

Garance A Drosihn drosih at rpi.edu
Mon Jul 7 10:37:13 PDT 2003


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 at gilead.netel.rpi.edu
Senior Systems Programmer           or  gad at freebsd.org
Rensselaer Polytechnic Institute    or  drosih at rpi.edu


More information about the cvs-src mailing list