libc/newlib/libc/include
Yaakov Selkowitz 6ba26630e0 Feature test macros overhaul: sys/features.h
This is the complete rework of the feature tests macros for better
compatibility with GNU libc, primarily based on the Linux man pages
documentation:

http://man7.org/linux/man-pages/man7/feature_test_macros.7.html

The previous implementation was flawed in its approach that macros were
often used to hide symbols if defined (e.g. !defined __STRICT_ANSI__ or
!defined _POSIX_SOURCE), whereas the approach of glibc is that these macros
make symbols available when defined (e.g. defined _BSD_SOURCE, or as used
internally, #if __BSD_VISIBLE).  As much open-source software is written
with glibc in mind, this necessitated patching numerous packages just to
compile.

In particular, __STRICT_ANSI__ (which is defined by gcc -ansi or -std=c*)
was given too much importance.  This implementation limits the influence
of __STRICT_ANSI__ to controlling the default when no other feature test
macros are defined, and to the inclusion of <alloca.h> in <stdlib.h> as
documented.  These are the only places where __STRICT_ANSI__ should be
tested.

The following macros are now accepted: _ATFILE_SOURCE, _BSD_SOURCE,
_DEFAULT_SOURCE, _ISOC99_SOURCE, _ISOC11_SOURCE, _LARGEFILE_SOURCE,
_SVID_SOURCE, _XOPEN_SOURCE_EXTENDED.

The existing __*_VISIBLE internal macros have been kept mostly
compatible with the original BSD implementation, with some changes to
the criteria which controls them.  Several more macros in this style
have been added where needed for concision or accuracy.

Enabling C++11 or newer in the compiler also enables C99 and C11
functions.  Doing so should help move away from the need to define
_GNU_SOURCE in g++ for _GLIBCXX_USE_C99 support as on Linux:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51749

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-17 21:06:40 -05:00
..
machine Add support for ARC to newlib 2015-11-12 14:14:17 +01:00
rpc * libc/include/locale.h (NULL): Fetch definition via stddef.h. 2012-11-01 11:51:12 +00:00
sys Feature test macros overhaul: sys/features.h 2016-03-17 21:06:40 -05:00
_ansi.h * libc/include/_ansi.h: _LONG_LONG_TYPE definition removed. 2014-10-10 14:43:19 +00:00
_newlib_version.h Fix _newlib_version.h logic to support building gcc with newlib. 2016-02-25 15:04:19 -05:00
_syslist.h 2009-12-17 Jeff Johnston <jjohnstn@redhat.com> 2009-12-17 21:08:04 +00:00
alloca.h 2006-12-13 Joel Schopp <jschopp@austin.ibm.com> 2006-12-13 23:01:21 +00:00
ar.h
argz.h * libc/argz/argz_create_sep.c (argz_create_sep): Initialize *argz_len 2007-05-23 16:36:23 +00:00
assert.h * libc/include/assert.h (static_assert): Define. 2012-10-16 19:00:30 +00:00
complex.h libm/complex: add clog10, clog10f 2016-02-22 14:43:41 -06:00
ctype.h * libc/include/ctype.h (__ctype_lookup): Fix precedence. 2009-11-06 03:27:19 +00:00
dirent.h
envlock.h 2008-10-31 Jeff Johnston <jjohnstn@redhat.com> 2008-10-31 21:03:42 +00:00
envz.h * libc/argz: New directory. 2002-06-14 20:51:09 +00:00
errno.h 2003-05-28 Jeff Johnston <jjohnstn@redhat.com> 2003-05-28 22:04:40 +00:00
fastmath.h
fcntl.h
fnmatch.h 2008-10-31 Jeff Johnston <jjohnstn@redhat.com> 2008-10-31 21:03:42 +00:00
getopt.h * newlib/libc/include/getopt.h (struct option): name field should be 2013-11-13 09:09:45 +00:00
glob.h 2013-11-21 Julio Gutierrez <jgutleyva@gmail.com> 2013-11-21 17:04:57 +00:00
grp.h include/grp.h: Remove prototypes of non-standard functions 2016-01-29 13:39:57 +01:00
iconv.h 2013-11-20 Daniel Ramirez <javamonn@gmail.com> 2013-11-20 13:39:36 +00:00
ieeefp.h Remove broken ieeefp.h macros 2016-02-12 11:35:56 -06:00
inttypes.h Fix for pri and scn formats 2015-08-27 12:50:25 +02:00
langinfo.h * libc/include/langinfo.h: Fix #endif positioning. 2010-04-30 14:58:28 +00:00
libgen.h Rework handling of basename variants 2015-07-06 14:58:51 -05:00
limits.h 2013-12-22 JF Bastien <jfb@chromium.org> 2013-12-23 19:21:07 +00:00
locale.h * libc/include/locale.h (NULL): Fetch definition via stddef.h. 2012-11-01 11:51:12 +00:00
malloc.h * libc/include/malloc.h (struct mallinfo): Convert type of all members 2013-02-26 14:25:13 +00:00
math.h * libc/include/complex.h (cabsl): Add prototype. 2015-02-06 16:14:04 +00:00
newlib.h 2002-08-28 Jeff Johnston <jjohnstn@redhat.com> 2002-08-28 23:42:53 +00:00
paths.h 2013-10-10 Sebastian Huber <sebastian.huber@embedded-brains.de> 2013-10-15 17:34:23 +00:00
pthread.h pthread.h, sys/types.h Add missing pthread methods 2016-02-22 10:05:17 -06:00
pwd.h * libc/include/pwd.h: Include <sys/cdefs.h>. 2014-02-09 20:02:17 +00:00
reent.h Port newlib to x86_64-pc-cygwin. 2013-04-23 09:42:25 +00:00
regdef.h
regex.h 2013-11-20 Chirayu Desai <chirayudesai1@gmail.com> 2013-11-20 16:25:50 +00:00
sched.h 2010-04-01 Joel Sherrill <joel.sherrill@oarcorp.com> 2010-04-01 18:33:37 +00:00
search.h 2013-11-20 Daniel Ramirez <javamonn@gmail.com> 2013-11-20 18:22:27 +00:00
setjmp.h * libc/include/setjmp.h (longjmp): Fix copy/paste error. 2014-01-20 17:23:41 +00:00
signal.h * libc/include/signal.h (psignal): Declare. 2011-05-04 11:26:22 +00:00
spawn.h * libc/include/spawn.h (posix_spawn_file_actions_destroy): Fix typo 2013-11-25 17:23:30 +00:00
stdatomic.h 2013-09-12 Sebastian Huber <sebastian.huber@embedded-brains.de> 2013-09-12 22:05:43 +00:00
stdint.h Improve check for int32_t being long or int 2015-04-29 13:07:17 +02:00
stdio.h Use __sputc_r inline code when building with gcc 2016-03-12 23:25:11 +01:00
stdio_ext.h * libc/include/stdio.h (__SNLK): Define. 2014-12-15 18:22:56 +00:00
stdlib.h Import correctly working strtold from David M. Gay. 2015-11-20 18:14:58 +01:00
string.h Rework handling of basename variants 2015-07-06 14:58:51 -05:00
strings.h * libc/include/strings.h: Don't include locale.h. 2010-12-08 10:28:40 +00:00
tar.h 2007-08-03 Ralf Corsepius <ralf.corsepius@rtems.org> 2007-08-03 21:03:40 +00:00
termios.h
tgmath.h * libc/include/sys/features.h (__GNUC_PREREQ): Define. Use 2012-10-16 18:45:24 +00:00
threads.h Import <threads.h> from latest FreeBSD. 2015-10-13 17:52:34 -04:00
time.h Add and use latest <sys/timespec.h> from FreeBSD 2015-03-11 15:45:38 +01:00
unctrl.h
unistd.h
utime.h 2002-07-04 Jeff Johnston <jjohnstn@redhat.com> 2002-07-04 22:51:08 +00:00
utmp.h
wchar.h * libc/include/stdio.h (FILE): Protect typedef from redefinition. 2015-03-05 17:15:24 +00:00
wctype.h 2002-11-06 Kazuhiro Fujieda <fujieda@jaist.ac.jp> 2002-11-07 00:44:31 +00:00
wordexp.h 2013-11-23 Bryan Dunsmore <dunsmoreb@gmail.com> 2013-11-23 22:39:34 +00:00