From bea3ed6f50776e19fd997bbb5923f592a3e3711f Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Mon, 23 Sep 2013 00:05:38 +0200 Subject: [PATCH] Detect internal system component build macros in . --- libc/include/features.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/libc/include/features.h b/libc/include/features.h index da5b2e29..1fc0e815 100644 --- a/libc/include/features.h +++ b/libc/include/features.h @@ -27,6 +27,20 @@ #define __sortix_libc__ 1 +/* Detect whether we are a core system library. */ +#if __is_sortix_libc || __is_sortix_libm +#if !defined(__is_sortix_system_library) +#define __is_sortix_system_library 1 +#endif +#endif + +/* Detect whether we are a core system component. */ +#if __is_sortix_kernel || __is_sortix_system_library +#if !defined(__is_sortix_system_component) +#define __is_sortix_system_component 1 +#endif +#endif + /* Support macro to ease testing the compiler version. */ #define __GCC_PREREQ(gcc_major, gcc_minor) \ (((gcc_major) == __GNUC__ && (gcc_minor) >= __GNUC_MINOR__) || \ @@ -52,7 +66,7 @@ #endif /* Sortix system components implicitly use the native API. */ -#if __is_sortix_libc || __is_sortix_kernel +#if __is_sortix_system_component #define _SORTIX_SOURCE 1 #endif