From c688b4196014e0162a1ff11120f6c9516be0c6cb Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Thu, 19 Dec 2013 13:32:42 +0000 Subject: Add _DEFAULT_SOURCE feature test macro. This patch adds a feature test macro _DEFAULT_SOURCE to enable the default set of header declarations. The intention is: if _DEFAULT_SOURCE is not used there is no change to the set of __USE_* macros glibc defines; if it's used on its own, and without compiler options such as -std=c99 that define __STRICT_ANSI__, again, there is no change; if it's used together with the macros it approximately (i.e., apart from __USE_POSIX_IMPLICITLY) implies (-D_BSD_SOURCE -D_SVID_SOURCE -D_POSIX_C_SOURCE=200809L), again, there is no change. Otherwise, it causes the relevant features to be enabled, even if __STRICT_ANSI__, or another feature test macro, would cause them to be disabled. This macro deliberately bundles the POSIX.1-2008 (non-X/Open) functionality with the BSD/SVID/"misc" functionality, rather than defining a macro that gives just the latter, as many of the header cleanups resulting from removing _BSD_SOURCE and _SVID_SOURCE support are only possible when BSD/SVID/"misc" is always bundled with POSIX.1-2008. Tested x86_64. * include/features.h: Update comment documenting feature test macros. Mention _DEFAULT_SOURCE in comment. [_GNU_SOURCE] (_DEFAULT_SOURCE): Undefine and redefine. [_DEFAULT_SOURCE]: Undefine and redefine _DEFAULT_SOURCE, _BSD_SOURCE and _SVID_SOURCE. [!__STRICT_ANSI__ && !_ISOC99_SOURCE && !_POSIX_SOURCE && !_POSIX_C_SOURCE && !_XOPEN_SOURCE && !_BSD_SOURCE && !_SVID_SOURCE]: Likewise. [_DEFAULT_SOURCE && !_POSIX_SOURCE && !_POSIX_C_SOURCE] (__USE_POSIX_IMPLICITLY): Define. [_DEFAULT_SOURCE && !_POSIX_SOURCE && !_POSIX_C_SOURCE] (_POSIX_SOURCE): Undefine and redefine. [_DEFAULT_SOURCE && !_POSIX_SOURCE && !_POSIX_C_SOURCE] (_POSIX_C_SOURCE): Likewise. * manual/creature.texi (_DEFAULT_SOURCE): Document. (Feature Test Macros): Update documentation of default features. --- ChangeLog | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index bee6f8be78..727688e124 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2013-12-19 Joseph Myers + + * include/features.h: Update comment documenting feature test + macros. Mention _DEFAULT_SOURCE in comment. + [_GNU_SOURCE] (_DEFAULT_SOURCE): Undefine and redefine. + [_DEFAULT_SOURCE]: Undefine and redefine _DEFAULT_SOURCE, + _BSD_SOURCE and _SVID_SOURCE. + [!__STRICT_ANSI__ && !_ISOC99_SOURCE && !_POSIX_SOURCE && + !_POSIX_C_SOURCE && !_XOPEN_SOURCE && !_BSD_SOURCE && + !_SVID_SOURCE]: Likewise. + [_DEFAULT_SOURCE && !_POSIX_SOURCE && !_POSIX_C_SOURCE] + (__USE_POSIX_IMPLICITLY): Define. + [_DEFAULT_SOURCE && !_POSIX_SOURCE && !_POSIX_C_SOURCE] + (_POSIX_SOURCE): Undefine and redefine. + [_DEFAULT_SOURCE && !_POSIX_SOURCE && !_POSIX_C_SOURCE] + (_POSIX_C_SOURCE): Likewise. + * manual/creature.texi (_DEFAULT_SOURCE): Document. + (Feature Test Macros): Update documentation of default features. + 2013-12-19 Rajalakshmi Srinivasaraghavan * benchtests/Makefile: Add bench-strtok. -- cgit v1.2.3