Date: Sat, 6 Mar 2004 23:04:09 -0800 From: Marcel Moolenaar <marcel@xcllnt.net> To: Tim Kientzle <tim@kientzle.com> Cc: hackers@freebsd.org Subject: Re: Style(9) and portability Message-ID: <20040307070409.GB2045@dhcp01.pn.xcllnt.net> In-Reply-To: <404A320D.8090905@kientzle.com> References: <404A320D.8090905@kientzle.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Mar 06, 2004 at 12:18:21PM -0800, Tim Kientzle wrote: > One of the recommendations in style(9) is > inherently non-portable. I'm trying > to ensure that the new code I'm writing > for FreeBSD is portable to other systems, > so I've been scratching my head over > how to deal with the version ID code > that is supposed to apear as the first > two lines of any FreeBSD source file: > > #include <sys/cdefs.h> > __FBSDID("$FreeBSD$"); > > Clearly, I cannot reasonably assume that all > platforms define a __FBSDID macro in > sys/cdefs.h. Our compiler defines __FreeBSD__. You might be able to do: #ifdef __FreeBSD__ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); #endif The advantage of something like this is that you don't spam the library on non-FreeBSD systems. Just a thought... -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040307070409.GB2045>