From 144f45a030014cd10f7bacef223a1bf7e82a58f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= Date: Sun, 2 May 2021 13:07:42 +0200 Subject: [PATCH] features.h: enable ISOC11 definitions for _GNU_SOURCE and C++17 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this is needed for GCC to build after the aligned_alloc introduction Change-Id: Ieae32a050cc000561107c4a07cf10c912a196152 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3896 Reviewed-by: Jérôme Duval --- headers/compatibility/bsd/features.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/headers/compatibility/bsd/features.h b/headers/compatibility/bsd/features.h index b11d2ce1db..606584f380 100644 --- a/headers/compatibility/bsd/features.h +++ b/headers/compatibility/bsd/features.h @@ -12,11 +12,21 @@ #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 #undef _ISOC11_SOURCE #define _ISOC11_SOURCE #endif +#if defined(__cplusplus) && __cplusplus >= 201703L + #undef _ISOC11_SOURCE + #define _ISOC11_SOURCE +#endif #endif // _FEATURES_H