Date: Sun, 4 Mar 2001 14:11:58 -0500 (EST) From: Peter Dufault <dufault@hda.hda.com> To: current@freebsd.org Subject: Posix feature tests update Message-ID: <200103041912.f24JCYq46536@hda.hda.com>
next in thread | raw e-mail | index | archive | help
Critique, please. I'm building a large body of code with the following cc options: > -D_POSIX_VERSION=199506L -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199506L and one of my own: > -D_P1003_1G_VISIBLE together with locally hacked up headers. Here's how I'm hacking. This could go into current if no one objects. 1. In "sys/_posix.h" the test macro _BSD_TRADITIONAL is defined if neither _POSIX_SOURCE nor _POSIX_C_SOURCE are defined. In most system headers, those items currently bracketed by > #ifndef _POSIX_SOURCE instead are bracketed by > #ifdef _BSD_TRADITIONAL 2. What I'd previously put in sys/_posix.h as > #define _P1003_1B_VISIBLE is replaced by > #define _P1003_1_199309 The notion is that prior to a draft being finalized it is fine to select it with _P1003_1B_VISIBLE (or _P1003_1G_VISIBLE) since you don't know the final _POSIX_VERSION and it should be viewed with suspicion, but once it is finalized it should be replaced by the _POSIX_VERSION numeric id. 3. I'd get rid of the verbose and unclear: #define _P1003_1B_VISIBLE_HISTORICALLY and replace it with the inline (that is, repeated in the headers) test > #if defined(_BSD_TRADITIONAL) || defined(_P1003_1_199309) 4. Everything added in the 1995 P1003.1 is bracketed by > #ifdef _P1003_1_199506 or > #if defined(_BSD_TRADITIONAL) || defined(_P1003_1_199506) as appropriate, i.e. if brand new it gets the first test, if pre-existing it gets the second. 5. Those items from the draft Posix 1003.1-G are bracketed by _P1003_1G_VISIBLE optionally or'd with _BSD_TRADITIONAL, as needed. -- It is useful to specify the Posix version, but right now the lack of networking support makes it only marginally useful. Peter -- Peter Dufault (dufault@hda.com) Realtime development, Machine control, HD Associates, Inc. Fail-Safe systems, Agency approval To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103041912.f24JCYq46536>