From owner-freebsd-standards Sat Oct 12 13:21:31 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4103937B401; Sat, 12 Oct 2002 13:21:30 -0700 (PDT) Received: from hawk.mail.pas.earthlink.net (hawk.mail.pas.earthlink.net [207.217.120.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id D393743EAC; Sat, 12 Oct 2002 13:21:29 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0083.cvx21-bradley.dialup.earthlink.net ([209.179.192.83] helo=mindspring.com) by hawk.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 180Sl8-0000KU-00; Sat, 12 Oct 2002 13:21:15 -0700 Message-ID: <3DA883F2.33E84C@mindspring.com> Date: Sat, 12 Oct 2002 13:20:03 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Tony Finch Cc: Bruce Evans , Craig Rodrigues , freebsd-standards@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Subject: Re: Problem detecting POSIX symbolic constants References: <20021012171803.F15910-100000@gamplex.bde.org> <3DA7E0F4.5988CA77@mindspring.com> <20021012151336.A24868@chiark.greenend.org.uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Tony Finch wrote: > > With just an "&" or an "|", you actually need a much less complicated > > state machine to evaluate a constant expression. With the "||"/"&&", > > you almost have to do an edge associative operation, which implies a > > much more complex state machine for the preprocessor, I think. > > No -- the short-circuiting behaviour of && and || only matters if > you can have side-effects, which you can't in the preprocessor, > so there is no need to implement it (unifdef doesn't). Consider: #if _DEFINED_SUPPORTED && defined(SOMETHING) -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message