Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/cdefs.h
Show All 12 Lines | |||||
* _POSIX_C_SOURCE, we will assume that it wants the broader compilation | * _POSIX_C_SOURCE, we will assume that it wants the broader compilation | ||||
* environment (and in fact we will never get here). | * environment (and in fact we will never get here). | ||||
*/ | */ | ||||
#if defined(_ANSI_SOURCE) /* Hide almost everything. */ | #if defined(_ANSI_SOURCE) /* Hide almost everything. */ | ||||
#define __POSIX_VISIBLE 0 | #define __POSIX_VISIBLE 0 | ||||
#define __XSI_VISIBLE 0 | #define __XSI_VISIBLE 0 | ||||
#define __BSD_VISIBLE 0 | #define __BSD_VISIBLE 0 | ||||
#define __ISO_C_VISIBLE 1990 | #define __ISO_C_VISIBLE 1990 | ||||
#define __EXT1_VISIBLE 0 | |||||
#elif defined(_C99_SOURCE) /* Localism to specify strict C99 env. */ | #elif defined(_C99_SOURCE) /* Localism to specify strict C99 env. */ | ||||
#define __POSIX_VISIBLE 0 | #define __POSIX_VISIBLE 0 | ||||
#define __XSI_VISIBLE 0 | #define __XSI_VISIBLE 0 | ||||
#define __BSD_VISIBLE 0 | #define __BSD_VISIBLE 0 | ||||
#define __ISO_C_VISIBLE 1999 | #define __ISO_C_VISIBLE 1999 | ||||
#define __EXT1_VISIBLE 0 | |||||
#elif defined(_C11_SOURCE) /* Localism to specify strict C11 env. */ | #elif defined(_C11_SOURCE) /* Localism to specify strict C11 env. */ | ||||
#define __POSIX_VISIBLE 0 | #define __POSIX_VISIBLE 0 | ||||
#define __XSI_VISIBLE 0 | #define __XSI_VISIBLE 0 | ||||
#define __BSD_VISIBLE 0 | #define __BSD_VISIBLE 0 | ||||
#define __ISO_C_VISIBLE 2011 | #define __ISO_C_VISIBLE 2011 | ||||
#define __EXT1_VISIBLE 0 | |||||
#else /* Default environment: show everything. */ | #else /* Default environment: show everything. */ | ||||
#define __POSIX_VISIBLE 200809 | #define __POSIX_VISIBLE 200809 | ||||
#define __XSI_VISIBLE 700 | #define __XSI_VISIBLE 700 | ||||
#define __BSD_VISIBLE 1 | #define __BSD_VISIBLE 1 | ||||
#define __ISO_C_VISIBLE 2011 | #define __ISO_C_VISIBLE 2011 | ||||
#define __EXT1_VISIBLE 1 | |||||
#endif | #endif | ||||
#endif | #endif | ||||
/* User override __EXT1_VISIBLE */ | |||||
#if defined(__STDC_WANT_LIB_EXT1__) | |||||
#undef __EXT1_VISIBLE | |||||
#if __STDC_WANT_LIB_EXT1__ | |||||
kib: This is a generic comment to the change in cdefs.h. I do not think that the proposed setup of… | |||||
Not Done Inline ActionsI suspect you want to #undef __EXT1_VISIBLE before redefining. Some warning levels on some compilers catch this. kib: I suspect you want to #undef __EXT1_VISIBLE before redefining. Some warning levels on some… | |||||
#define __EXT1_VISIBLE 1 | |||||
#else | |||||
Not Done Inline ActionsWhy ? This overrides the setting from the _BSD_VISIBLE case. Just drop the #else block. kib: Why ? This overrides the setting from the _BSD_VISIBLE case. Just drop the #else block. | |||||
Not Done Inline ActionsThere should be a way for the user to explicitly turn this feature off, this would be done if the user did -DSTDC_WANT_EXT1=0, from K3.1.1 trix_juniper.net: There should be a way for the user to explicitly turn this feature off, this would be done if… | |||||
Not Done Inline ActionsI see, thanks. kib: I see, thanks. | |||||
#define __EXT1_VISIBLE 0 | |||||
#endif | |||||
#endif /* __STDC_WANT_LIB_EXT1__ */ | |||||
#if defined(__mips) || defined(__powerpc64__) || defined(__riscv__) | #if defined(__mips) || defined(__powerpc64__) || defined(__riscv__) | ||||
#define __NO_TLS 1 | #define __NO_TLS 1 | ||||
#endif | #endif | ||||
/* | /* | ||||
* Old versions of GCC use non-standard ARM arch symbols; acle-compat.h | * Old versions of GCC use non-standard ARM arch symbols; acle-compat.h | ||||
* translates them to __ARM_ARCH and the modern feature symbols defined by ARM. | * translates them to __ARM_ARCH and the modern feature symbols defined by ARM. | ||||
*/ | */ | ||||
Show All 12 Lines |
This is a generic comment to the change in cdefs.h. I do not think that the proposed setup of visibility would be useful.
As I noted before, by default we expose everything, which in particular means that BSD_VISIBLE is 1. As such, we should define EXT1_VISIBLE to 1 if we are providing the default environments.
For all other cases (of ANSI C and strict posix environments) __EXT1_VISIBLE must be 0 by default, as you defined, but setting it to 1 on STDC_WANT_LIB_EXT1 should be independent of the restriction macros. To say it simple, the check for the _WANT_ should be done in separate #if block and not in #elif.