From owner-freebsd-hackers Thu Oct 10 5: 8:15 2002 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 07FE937B407 for ; Thu, 10 Oct 2002 05:08:12 -0700 (PDT) Received: from nic.upatras.gr (nic.upatras.gr [150.140.129.30]) by mx1.FreeBSD.org (Postfix) with SMTP id 2344843EA3 for ; Thu, 10 Oct 2002 05:08:10 -0700 (PDT) (envelope-from keramida@ceid.upatras.gr) Received: (qmail 4100 invoked from network); 10 Oct 2002 12:01:10 -0000 Received: from upnet-dialinpool-103.upnet.gr (HELO hades.hell.gr) (@150.140.128.151) by nic.upatras.gr with SMTP; 10 Oct 2002 12:01:10 -0000 Received: from hades.hell.gr (hades [127.0.0.1]) by hades.hell.gr (8.12.6/8.12.6) with ESMTP id g9AC894w041390; Thu, 10 Oct 2002 15:08:11 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by hades.hell.gr (8.12.6/8.12.6/Submit) id g9ABOZjf036551; Thu, 10 Oct 2002 14:24:35 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Thu, 10 Oct 2002 14:24:34 +0300 From: Giorgos Keramidas To: Terry Lambert Cc: Garrett Wollman , Craig Rodrigues , freebsd-standards@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: Problem detecting POSIX symbolic constants Message-ID: <20021010112434.GS21391@hades.hell.gr> References: <20021009222307.A9894@attbi.com> <200210100549.g9A5nFLn060516@khavrinen.lcs.mit.edu> <3DA5354F.9BB3E54B@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3DA5354F.9BB3E54B@mindspring.com> X-PGP-Fingerprint: C1EB 0653 DB8B A557 3829 00F9 D60F 941A 3186 03B6 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 2002-10-10 01:07, Terry Lambert wrote: > > So the test is: > > #ifdef _POSIX_REALTIME_SIGNALS > #if _POSIX_REALTIME_SIGNALS > 0 > > ...or, if you want to assume all preprocessors support "#if": > > #if defined(_POSIX_REALTIME_SIGNALS) && (_POSIX_REALTIME_SIGNALS > 0) > > I think the first is safer, in that if "#if" is not supported, it > being an undefined preprocessor directive would be non-fatal, > being in an uncompiled "#ifdef" block... Well, almost. There is one exception. A compiler that doesn't support #if but happens to run in an environment that has _POSIX_REALTIME_SIGNALS defined and equal to -1. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message