haiku/headers/compatibility/bsd/features.h
Augustin Cavalier 7ec1bedeed features.h: Define _DEFAULT_SOURCE when _GNU_SOURCE is defined.
As suggested by PulkoMandy. This was done before my commits yesterday,
but those just reverted patches that had only been in since May,
so it's not clear how much this is actually needed. Nonetheless
it seems like the more correct thing to do.
2021-11-17 13:55:50 -05:00

24 lines
524 B
C

/*
* Copyright 2019-2021, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _FEATURES_H
#define _FEATURES_H
#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) \
|| (!defined(__STRICT_ANSI__) && !defined(_POSIX_C_SOURCE))
#undef _DEFAULT_SOURCE
#define _DEFAULT_SOURCE
#endif
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) \
|| (defined(__cplusplus) && __cplusplus >= 201103L)
#undef _ISOC11_SOURCE
#define _ISOC11_SOURCE
#endif
#endif // _FEATURES_H