Commit Graph

6 Commits

Author SHA1 Message Date
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
PulkoMandy dbe86e4638 regex.h: use _DEFAULT_SOURCE
This file was imported from glibx and uses __USE_GNU as defined by
glibc(s features.h. Our implementation of features.h is simpler, just
defining _DEFAULT_SOURCE directly and that's what we use in other
headers.

As a result, using GNU extensions to regex.h required defining __USE_GNU
directly in applications (for example in TraX).

Fixes #11818

Change-Id: I11e4cf2e88c330cf58083852c4b33aedb8a3a9ea
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7238
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-12-30 18:09:57 +00:00
Jérôme Duval 867b56657b use __haiku_addr_t instead of __haiku_uint32
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38098 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-14 11:58:02 +00:00
Jérôme Duval 5091a866ec To be validated as part of bug #6386. Update glibc regex to 2.11, headers/posix/regex.h included. This imposes some changes in some of our sources using the regex.h,
mostly bin tools and mail kit. The use of __USE_GNU macro is needed for instance when the expected regex implementation is the GNU one.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38031 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-11 16:49:58 +00:00
Ingo Weinhold 2222d0559d * Introduced new header directory "config", which ATM contains HaikuConfig.h
and types.h. The idea is to provide a basic architecture/compiler
  abstraction by defining types and macros that allow the posix/ and os/
  headers to be mostly architecture/compiler agnostic. 
* Adjusted the posix/ and os/ headers accordingly.
* <SupportDefs.h>: Introduced B_PRI* and B_SCN* macros similar to the PRI*
  and SCN* macros defined in <inttypes.h>, just for the BeOS/Haiku [u]int*
  types and some POSIX types (e.g. off_t, dev_t, ino_t) that don't have POSIX
  macros. Also the B_PRI* and B_SCN* macros are available unconditionally,
  unlike the <inttypes.h> macros, which require __STDC_FORMAT_MACROS to be
  defined in C++ mode.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34214 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-24 19:44:07 +00:00
Philippe Houdoin 38c2785626 Missing header file, required to build src/apps/bin/grep-2.5 and it's, indeed,
required by POSIX 1003.1g.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7543 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-12 22:47:31 +00:00