From 68a13ed5c3d83f34fe11dbfed033b5d5b1b171bb Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 16 Nov 2021 15:11:44 -0500 Subject: [PATCH] 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. --- headers/compatibility/bsd/features.h | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/headers/compatibility/bsd/features.h b/headers/compatibility/bsd/features.h index 606584f380..50d35b4334 100644 --- a/headers/compatibility/bsd/features.h +++ b/headers/compatibility/bsd/features.h @@ -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