From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 14 10:18:51 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 4408E16A41F for ; Wed, 14 Dec 2005 10:18:51 +0000 (GMT) (envelope-from stefan@fafoe.narf.at) Received: from viefep14-int.chello.at (viefep14-int.chello.at [213.46.255.13]) by mx1.FreeBSD.org (Postfix) with ESMTP id 290E143D5E for ; Wed, 14 Dec 2005 10:18:49 +0000 (GMT) (envelope-from stefan@fafoe.narf.at) Received: from wombat.fafoe.narf.at ([213.47.85.26]) by viefep14-int.chello.at (InterMail vM.6.01.04.04 201-2131-118-104-20050224) with ESMTP id <20051214101847.USNQ23858.viefep14-int.chello.at@wombat.fafoe.narf.at>; Wed, 14 Dec 2005 11:18:47 +0100 Received: by wombat.fafoe.narf.at (Postfix, from userid 1001) id 9C59CBF07; Wed, 14 Dec 2005 11:18:46 +0100 (CET) Date: Wed, 14 Dec 2005 11:18:46 +0100 From: Stefan Farfeleder To: Hans Petter Selasky Message-ID: <20051214101844.GE608@wombat.fafoe.narf.at> Mail-Followup-To: Hans Petter Selasky , freebsd-hackers@freebsd.org References: <200512131936.11640.hselasky@c2i.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200512131936.11640.hselasky@c2i.net> User-Agent: Mutt/1.5.11 Cc: freebsd-hackers@freebsd.org Subject: Re: Standard C-macro scripting X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Dec 2005 10:18:51 -0000 On Tue, Dec 13, 2005 at 07:36:10PM +0100, Hans Petter Selasky wrote: > Hi, > > What do you think about defining the following macros like this: > > #ifndef NOT > #define NOT(arg) _NOT(YES arg(() NO)) > #define _NOT(args...) args > #endif If you're interested in standards conforming code (as you seem to imply in the subject), use this instead: #define _NOT(...) __VA_ARGS__ Stefan