haiku/headers/posix
Adrien Destugues 8d27b645e7 features.h: fix build when BSD headers are not in include path
In our C library we try to provide a "clean" POSIX/ISO-C set of include
files that strictly conforming applications can use. However, we also
want to provide some extensions that are commonly available in BSD or
GNU systems.

These are normally provided in a separate directory
(headers/compatibility/bsd) and additionally guarded by compiler defines
that can either be explicitly set, or enabled by default if the language
standard (selected from the compiler command line) is one with GNU
extensions (this is the default for GCC). This is controlled by a header
file called features.h.

However, for some headers it is not so simple to split the GNU
extensions apart from the other parts of the file, because it's not just
extra functions, but additional flags and defines.

So, we need the "features.h" mechanism to be available even in the base
set of headers, but not enable anything if the BSD headers are not in
the search path. The simplest way to achieve this is to have an empty
features.h in the base set of headers, that can then be overriden by the
one in headers/compatibility/bsd if needed.

Fixes #18732

Change-Id: Ia54d1206c2fba378ae276ed4232aee8443180afb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7287
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-01-03 17:11:56 +00:00
..
arch kernel/arm: implement signals, fork, restart syscall 2023-03-20 17:28:20 +00:00
arpa arpa/nameser.h: Fix build on GCC8. 2020-07-03 15:30:00 -04:00
compat/sys Updated copyright in headers. No functional change. 2012-07-19 18:14:06 +00:00
net net: Rename IFT_TUN to IFT_TUNNEL as on BSD 2023-12-10 19:50:48 +00:00
netinet headers: More removal of the BSD Advertising Clause. 2020-07-03 15:00:37 -04:00
netinet6 in6.h: declare in6_addr with a union and extra fields 2020-10-23 08:13:03 +00:00
sys sys/resource.h: add rusage compatibility fields, set to zero 2021-06-20 12:50:24 +00:00
alloca.h Updated copyright in headers. No functional change. 2012-07-19 18:14:06 +00:00
assert.h headers: Define static_assert for C11 2023-09-04 05:58:31 +00:00
complex.h complex.h: add a C++ guard. 2016-10-05 09:18:42 +02:00
ctype.h libs/posix: Implemented new locale functions 2022-07-11 16:30:16 +00:00
dirent.h dirent: Use an actual flexible-length array for d_name. 2021-11-18 16:34:03 -05:00
div_t.h Updated copyright in headers. No functional change. 2012-07-19 18:14:06 +00:00
dlfcn.h libroot.so: make first parameter of dladdr() const. 2017-09-15 23:09:24 +02:00
endian.h Clarify endianness defines. 2019-08-27 17:44:57 +02:00
errno.h Updated copyright in headers. No functional change. 2012-07-19 18:14:06 +00:00
fcntl.h fcntl.h: define O_DIRECT directly 2020-11-20 18:23:35 +00:00
features.h features.h: fix build when BSD headers are not in include path 2024-01-03 17:11:56 +00:00
fenv.h riscv: cleanup architecture macro checks 2021-09-01 18:04:59 +00:00
fnmatch.h fnmatch: Replace BSD implementation with musl one. 2020-07-03 15:09:33 -04:00
ftw.h libroot: Replace ftw/nftw implemenations with their musl counterparts. 2022-06-09 16:24:11 -04:00
getopt.h Updated copyright in headers. No functional change. 2012-07-19 18:14:06 +00:00
glob.h headers: More removal of the BSD Advertising Clause. 2020-07-03 15:00:37 -04:00
grp.h Updated copyright in headers. No functional change. 2012-07-19 18:14:06 +00:00
inttypes.h Remove __STDC_FORMAT/CONSTANT_MACROS 2017-06-04 17:29:29 +02:00
iovec.h Updated copyright in headers. No functional change. 2012-07-19 18:14:06 +00:00
langinfo.h libs/posix: Implemented new locale functions 2022-07-11 16:30:16 +00:00
libgen.h Updated copyright in headers. No functional change. 2012-07-19 18:14:06 +00:00
libio.h posix: protect EOF being parsed as operator and 1 2021-01-25 18:53:43 +00:00
limits.h regex.h: use _DEFAULT_SOURCE 2023-12-30 18:09:57 +00:00
locale_t.h locale_t.h: Add missing newline at end of file. 2023-04-25 12:38:37 -04:00
locale.h libs/posix: Implemented new locale functions 2022-07-11 16:30:16 +00:00
malloc_debug.h malloc_debug: Implement allocation dump on exit in guarded heap. 2015-04-10 17:04:28 +02:00
malloc.h Allow gcc to know result is aligned 2021-10-14 16:19:18 +00:00
math.h math.h: Change definition of FP_ILOGB0 to match the specification. 2023-04-08 12:30:15 -04:00
memory.h Updated copyright in headers. No functional change. 2012-07-19 18:14:06 +00:00
monetary.h libs/posix: Implemented new locale functions 2022-07-11 16:30:16 +00:00
netdb.h Rewrite <netdb.h> and drop a lot of non-standard stuff. 2023-02-27 22:51:17 -05:00
nl_types.h Updated copyright in headers. No functional change. 2012-07-19 18:14:06 +00:00
null.h Updated copyright in headers. No functional change. 2012-07-19 18:14:06 +00:00
poll.h POSIX: introduce ppoll 2021-06-19 18:09:25 +00:00
pthread.h pthread: Use 1 for PTHREAD_BARRIER_SERIAL_THREAD. 2023-06-07 15:12:11 +00:00
pwd.h Updated copyright in headers. No functional change. 2012-07-19 18:14:06 +00:00
regex.h features.h: fix build when BSD headers are not in include path 2024-01-03 17:11:56 +00:00
resolv.h resolv.h & netdb.h: Clean up and simplify. 2020-07-02 19:33:51 -04:00
sched.h Updated copyright in headers. No functional change. 2012-07-19 18:14:06 +00:00
search.h libroot: Fix previous commit. 2021-09-17 15:35:51 -04:00
semaphore.h POSIX: introduce sem_clockwait 2022-02-18 21:27:06 +00:00
setjmp.h setjmp.h: add noreturn keyword on longjmp variants. 2018-07-21 12:27:27 +02:00
shadow.h Updated copyright in headers. No functional change. 2012-07-19 18:14:06 +00:00
signal.h signal.h: Look for _DEFAULT_SOURCE not __USE_GNU for sighandler_t. 2023-08-30 17:31:31 -04:00
size_t.h Updated copyright in headers. No functional change. 2012-07-19 18:14:06 +00:00
spawn.h s/Haiku License/MIT License/g. 2019-08-30 18:16:02 -04:00
stdint.h stdint.h: fix definition of UINT8_MAX, UINT16_MAX, UINT8_C and UINT16_C 2022-11-08 16:11:40 +00:00
stdio_ext.h Updated copyright in headers. No functional change. 2012-07-19 18:14:06 +00:00
stdio_post.h Updated copyright in headers. No functional change. 2012-07-19 18:14:06 +00:00
stdio_pre.h Updated copyright in headers. No functional change. 2012-07-19 18:14:06 +00:00
stdio.h posix: protect EOF being parsed as operator and 1 2021-01-25 18:53:43 +00:00
stdlib.h stdlib.h: Remove guards around aligned_alloc. 2021-11-16 15:13:29 -05:00
string.h libroot: Add stpncpy. 2023-11-28 20:37:15 -05:00
strings.h libs/posix: Implemented new locale functions 2022-07-11 16:30:16 +00:00
syslog.h syslog.h: add LOG_PRIMASK and LOG_PRI macros 2020-11-22 09:28:57 +00:00
tar.h added tar.h posix header. 2014-04-26 11:09:24 +02:00
termios.h termios.h: Undefine/remove some unimplemented BeOS extensions. 2023-05-22 18:20:17 -04:00
threads.h threads.h: Fix value of ONCE_FLAG_INIT. 2023-04-10 11:50:33 -04:00
time.h libs/posix: Implemented new locale functions 2022-07-11 16:30:16 +00:00
uchar.h uchar.h: Add missing include of stdint.h. 2023-04-08 12:30:14 -04:00
unistd.h Added missing posixoptions and sysconf constants according POSIX.1-2017 standard 2022-12-23 01:57:05 +00:00
utime.h Updated copyright in headers. No functional change. 2012-07-19 18:14:06 +00:00
utmpx.h utmpx.h: add ut_host for compatibility (not posix) 2021-03-16 16:55:44 +00:00
wchar_t.h Updated copyright in headers. No functional change. 2012-07-19 18:14:06 +00:00
wchar.h POSIX: wchar.h and wctype.h don't need the locale.h but locale_t.h 2022-11-02 14:09:08 +00:00
wctype.h POSIX: wchar.h and wctype.h don't need the locale.h but locale_t.h 2022-11-02 14:09:08 +00:00