From owner-freebsd-hackers Wed Oct 9 19:32:19 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 A459B37B401; Wed, 9 Oct 2002 19:32:17 -0700 (PDT) Received: from harrier.mail.pas.earthlink.net (harrier.mail.pas.earthlink.net [207.217.120.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1F00E43E4A; Wed, 9 Oct 2002 19:32:17 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0018.cvx21-bradley.dialup.earthlink.net ([209.179.192.18] helo=mindspring.com) by harrier.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 17zT7V-0000q7-00; Wed, 09 Oct 2002 19:32:13 -0700 Message-ID: <3DA4E61C.DCC8F543@mindspring.com> Date: Wed, 09 Oct 2002 19:29:48 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Craig Rodrigues Cc: freebsd-standards@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: Problem detecting POSIX symbolic constants References: <20021009222307.A9894@attbi.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 Craig Rodrigues wrote: > #ifdef _POSIX_REALTIME_SIGNALS > According to the letter of the law: > http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap02.html > > "The following symbolic constants shall either be undefined or defined > with a value other than -1." > > So, this is legal way to implement these macros. It just breaks my code. :) Crap. I missed that. To be totally correct, you will need to: #ifdef _POSIX_REALTIME_SIGNALS #if (_POSIX_REALTIME_SIGNALS != -1) ... #endif #endif It's annoying, but doing this will ensure that there are no gaps through which some system other than FreeBSD might fall. > If that is not an option, then what is the correct way for me to write > my code? Keep in mind that code in ACE must be very portable, and work > on platforms which may not adhere 100% to the letter of the POSIX law. This argues for two tests, instead of one. Sorry. PS: There is probably a technicality for wehther or not the "#if" directive is supported, seperately from the value compare. PPS: Technically, it doesn't say that the defined value has to be an integer type, either... some people are just jerks. 8-(. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message