From owner-freebsd-hackers@FreeBSD.ORG Sat Mar 6 23:04:10 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 59EFC16A4CE for ; Sat, 6 Mar 2004 23:04:10 -0800 (PST) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2603143D1D for ; Sat, 6 Mar 2004 23:04:10 -0800 (PST) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.10/8.12.10) with ESMTP id i27749OE022135; Sat, 6 Mar 2004 23:04:10 -0800 (PST) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) i27749kj002279; Sat, 6 Mar 2004 23:04:09 -0800 (PST) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.11/8.12.11/Submit) id i27749uf002278; Sat, 6 Mar 2004 23:04:09 -0800 (PST) (envelope-from marcel) Date: Sat, 6 Mar 2004 23:04:09 -0800 From: Marcel Moolenaar To: Tim Kientzle Message-ID: <20040307070409.GB2045@dhcp01.pn.xcllnt.net> References: <404A320D.8090905@kientzle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <404A320D.8090905@kientzle.com> User-Agent: Mutt/1.4.2.1i cc: hackers@freebsd.org Subject: Re: Style(9) and portability X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Mar 2004 07:04:10 -0000 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 > __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 __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