Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 09 Oct 2002 19:29:48 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Craig Rodrigues <rodrigc@attbi.com>
Cc:        freebsd-standards@freebsd.org, freebsd-hackers@freebsd.org
Subject:   Re: Problem detecting POSIX symbolic constants
Message-ID:  <3DA4E61C.DCC8F543@mindspring.com>
References:  <20021009222307.A9894@attbi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3DA4E61C.DCC8F543>