features.h: Clean up ISOC11 definitions.

* Do not define it merely when _GNU_SOURCE is defined, that is not needed.
 * Scale back __cplusplus check to 201103L, just like the BSDs do.
This commit is contained in:
Augustin Cavalier
2021-11-16 15:11:44 -05:00
parent 38dc3bf2c5
commit 68a13ed5c3
+3 -12
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Haiku, Inc. All rights reserved.
* Copyright 2019-2021, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _FEATURES_H
@@ -12,21 +12,12 @@
#define _DEFAULT_SOURCE
#endif
#if defined(_GNU_SOURCE)
#undef _ISOC11_SOURCE
#define _ISOC11_SOURCE
#undef _DEFAULT_SOURCE
#define _DEFAULT_SOURCE
#endif
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) \
|| (defined(__cplusplus) && __cplusplus >= 201103L)
#undef _ISOC11_SOURCE
#define _ISOC11_SOURCE
#endif
#if defined(__cplusplus) && __cplusplus >= 201703L
#undef _ISOC11_SOURCE
#define _ISOC11_SOURCE
#endif
#endif // _FEATURES_H