glibc/include
Joseph Myers c688b41960 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.
2013-12-19 13:32:42 +00:00
..
arpa Add first fixes for conformtest for POSIX2008 2012-02-26 21:32:56 -05:00
bits Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
gnu Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
net First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
netinet First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
programs sys/cdefs.h: export __attribute_alloc_size__ 2013-02-18 17:18:57 -05:00
protocols (abmon): Remove spaces. 1998-11-12 18:03:43 +00:00
rpc Avoid use of "register" as optimization hint. 2013-06-07 22:24:35 +00:00
rpcsvc * nis/nis_domain_of.c (__nis_domain_of): New function. 2007-04-19 14:28:01 +00:00
sys Fix indentation and add copyright header to time.h 2013-06-11 18:42:42 +05:30
aio.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
aliases.h Remove pre-ISO C support 2012-01-07 23:57:22 -05:00
alloca.h Account for alloca size rounding in extend_alloca 2011-11-01 18:29:34 +01:00
argp.h Update. 2000-12-28 15:08:51 +00:00
argz.h Remove use of INTDEF/INTUSE in intl 2012-05-24 23:08:18 +02:00
assert.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
atomic.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
byteswap.h
caller.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
complex.h conformtest: Fix namespace testing. 2013-09-04 20:47:21 +00:00
ctype.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
des.h
dirent.h Declare __getdirentries in internal dirent.h. 2012-08-15 10:09:18 -07:00
dlfcn.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
elf.h Check supported DF_1_XXX bits 2012-11-21 06:33:19 -08:00
endian.h Update. 2001-03-30 05:34:59 +00:00
envz.h 2002-08-03 Roland McGrath <roland@redhat.com> 2002-08-04 01:28:06 +00:00
err.h * include/sys/syslog.h: Use libc_hidden_proto for syslog, vsyslog. 2002-08-03 12:59:33 +00:00
errno.h Don't use GLIBC_PRIVATE errno outside of libraries 2013-02-04 10:01:54 +01:00
error.h
execinfo.h Remove pre-ISO C support 2012-01-07 23:57:22 -05:00
fcntl.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
features.h Add _DEFAULT_SOURCE feature test macro. 2013-12-19 13:32:42 +00:00
fenv.h Fix dbl-64 e_sqrt.c for non-default rounding modes (bug 16271). 2013-11-28 16:50:38 +00:00
fnmatch.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
fpu_control.h Update. 1999-11-23 17:22:17 +00:00
ftw.h
gconv.h
getopt.h Update. 2004-03-09 10:36:53 +00:00
getopt_int.h Update. 2004-03-09 10:36:53 +00:00
glob.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
gmp.h * include/gmp.h: Include/gmp-mparam.h. * stdlib/strtod.c: Include gmp-mparam.h before gmp.h and gmp-impl.h. 2003-03-14 05:48:18 +00:00
gnu-versions.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
grp.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
gshadow.h [BZ #9955] 2009-04-23 18:29:30 +00:00
iconv.h Update. 1999-08-21 00:38:15 +00:00
ifaddrs.h Cache network interface information 2011-10-31 01:51:16 -04:00
ifunc-impl-list.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
inline-hashtab.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
langinfo.h Add first fixes for conformtest for POSIX2008 2012-02-26 21:32:56 -05:00
libc-internal.h libc-internal.h: add ALIGN helper macros 2013-06-24 20:25:15 -04:00
libc-symbols.h Define TLS version of libc_hidden_proto. 2013-11-18 23:02:55 +00:00
libgen.h
libintl.h Remove use of INTDEF/INTUSE in intl 2012-05-24 23:08:18 +02:00
libio.h Remove use of INTDEF/INTUSE in libio 2012-05-24 23:06:20 +02:00
limits.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
link.h Add #include <stdint.h> for uint[32|64]_t usage (except installed headers). 2013-05-16 11:32:54 -05:00
locale.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
malloc.h * malloc/malloc.c (_int_free): Second argument is now mchunkptr. 2009-02-07 22:01:49 +00:00
math.h New <math.h> macro named issignaling to check for a signaling NaN (sNaN). 2013-04-02 13:51:02 +02:00
mcheck.h * include/sys/resource.h: Use libc_hidden_proto for getpriority, 2002-08-04 03:50:21 +00:00
memory.h
mntent.h Remove use of INTUSE/INTDEF in misc. 2012-05-31 13:10:02 +02:00
monetary.h Add first fixes for conformtest for POSIX2008 2012-02-26 21:32:56 -05:00
mqueue.h Update. 2004-04-13 02:15:43 +00:00
netdb.h Clean up h_errno declaration to use __thread unconditionally. 2013-08-27 11:09:33 -07:00
netgroup.h
nl_types.h
nss.h
nsswitch.h
obstack.h Update. 2002-08-04 09:27:27 +00:00
poll.h Update. 2000-08-21 16:02:48 +00:00
printf.h Update. 2002-08-03 07:02:10 +00:00
pthread.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
pty.h Update. 2004-10-24 21:29:41 +00:00
pwd.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
regex.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
resolv.h Clean up _res declaration to use __thread unconditionally. 2013-08-27 11:04:46 -07:00
rounding-mode.h Remove lots of inline keywords. 2013-02-07 14:44:18 -08:00
sched.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
search.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
set-hooks.h Remove __ptrvalue, __bounded and __unbounded. 2013-02-13 23:30:40 +00:00
setjmp.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
sgtty.h
shadow.h Remove pre-ISO C support 2012-01-07 23:57:22 -05:00
shlib-compat.h Remove --disable-versioning. 2013-09-04 15:25:42 +00:00
signal.h Remove use of INTDEF/INTUSE in stdio-common 2012-06-01 01:25:41 +02:00
spawn.h Update. 2000-10-01 19:15:29 +00:00
stab.h
stap-probe.h [BZ #16195] Fix build warnings from systemtap probes in non-systemtap configurations 2013-12-03 12:26:12 +05:30
stdc-predef.h Define __STDC_IEC_559* based on __GCC_IEC_559*. 2013-11-04 15:43:57 +00:00
stdio.h Remove use of INTDEF/INTUSE in libio 2012-05-24 23:06:20 +02:00
stdio_ext.h Remove use of INTDEF/INTUSE in libio 2012-05-24 23:06:20 +02:00
stdlib.h Avoid unconditional __call_tls_dtors calls in static linking. 2013-03-28 16:52:57 -07:00
string.h Make __ffs hidden 2013-09-20 21:25:31 +02:00
strings.h
stropts.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
stubs-prologue.h * sysdeps/generic/bits/libc-tsd.h [USE___THREAD]: Conditional 2002-10-11 10:52:20 +00:00
syscall.h
sysexits.h
syslog.h
tar.h
termios.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
tgmath.h Update. 1998-09-06 23:45:24 +00:00
time.h Fix symbol definitions for __clock_* functions 2013-06-11 11:11:11 +05:30
ttyent.h * include/search.h: Use libc_hidden_proto for hsearch_r, lfind. 2002-08-04 01:29:29 +00:00
uchar.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
ucontext.h Update. 1999-10-12 18:17:41 +00:00
ulimit.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
unistd.h add attribute_hidden to __have_{sock_cloexec,pipe2,dup3 2012-08-18 01:54:12 -04:00
utime.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
utmp.h Remove pre-ISO C support 2012-01-07 23:57:22 -05:00
values.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
wchar.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
wctype.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
wordexp.h First steps to get conformtest fully working 2012-02-25 23:18:39 -05:00
xlocale.h