Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/cdefs.h
Show First 20 Lines • Show All 712 Lines • ▼ Show 20 Lines | |||||||||
#define __ISO_C_VISIBLE 1990 | #define __ISO_C_VISIBLE 1990 | ||||||||
#elif _POSIX_C_SOURCE >= 199009 | #elif _POSIX_C_SOURCE >= 199009 | ||||||||
#define __POSIX_VISIBLE 199009 | #define __POSIX_VISIBLE 199009 | ||||||||
#define __ISO_C_VISIBLE 1990 | #define __ISO_C_VISIBLE 1990 | ||||||||
#else | #else | ||||||||
#define __POSIX_VISIBLE 198808 | #define __POSIX_VISIBLE 198808 | ||||||||
#define __ISO_C_VISIBLE 0 | #define __ISO_C_VISIBLE 0 | ||||||||
#endif /* _POSIX_C_SOURCE */ | #endif /* _POSIX_C_SOURCE */ | ||||||||
/* | |||||||||
* glibc enables c11 features when _ISOC11_SOURCE is defined, or when compiling | |||||||||
* with -stdc=c11. OpenBSD does explicitly as well for both as well. A strict | |||||||||
olceUnsubmitted Not Done Inline Actions
olce: | |||||||||
* reading of the standard would suggest doing it only for the former. However, | |||||||||
Not Done Inline ActionsSome typos: olce: Some typos:
`complaint` => `compliant`
`definning` => `defining` | |||||||||
Not Done Inline Actions
arichardson: | |||||||||
* a strict reading also requires C99 mode only, so C11 is already undefined. | |||||||||
Not Done Inline ActionsAlso: olce: Also:
`complaint` => `compliant` | |||||||||
Not Done Inline Actions
arichardson: | |||||||||
* To be maximially useful, we follow glibc's and OpenBSD's lead for this | |||||||||
olceUnsubmitted Not Done Inline Actions
olce: | |||||||||
* non-standard configuration. | |||||||||
*/ | |||||||||
#if _ISOC11_SOURCE || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) | |||||||||
#undef __ISO_C_VISIBLE | |||||||||
#define __ISO_C_VISIBLE 2011 | |||||||||
#endif | |||||||||
#else | #else | ||||||||
/*- | /*- | ||||||||
* Deal with _ANSI_SOURCE: | * Deal with _ANSI_SOURCE: | ||||||||
* If it is defined, and no other compilation environment is explicitly | * If it is defined, and no other compilation environment is explicitly | ||||||||
Not Done Inline Actionsglibc compatibility is good. What about _C99_SOURCE, used below in the _ANSI_SOURCE block? I could not relate it to any standard. Shouldn't it be taken into account as well? olce: glibc compatibility is good.
What about _C99_SOURCE, used below in the _ANSI_SOURCE block? I… | |||||||||
Not Done Inline ActionsSorry, obviously, I meant _C11_SOURCE. olce: Sorry, obviously, I meant `_C11_SOURCE`. | |||||||||
Not Done Inline ActionsIt's already handled below. It's the default. imp: It's already handled below. It's the default.
| |||||||||
Not Done Inline ActionsIt's not, because the case below is not parsed when _POSIX_C_SOURCE is defined. I was talking about _POSIX_C_SOURCE and _C11_SOURCE both defined. olce: It's not, because the case below is not parsed when _POSIX_C_SOURCE is defined. I was talking… | |||||||||
Done Inline Actions_C11_SOURCE is a private FreeBSD for the source tree only, and we don't need this there. imp: _C11_SOURCE is a private FreeBSD for the source tree only, and we don't need this there. | |||||||||
* requested, then define our internal feature-test macros to zero. This | * requested, then define our internal feature-test macros to zero. This | ||||||||
* makes no difference to the preprocessor (undefined symbols in preprocessing | * makes no difference to the preprocessor (undefined symbols in preprocessing | ||||||||
* expressions are defined to have value zero), but makes it more convenient for | * expressions are defined to have value zero), but makes it more convenient for | ||||||||
* a test program to print out the values. | * a test program to print out the values. | ||||||||
* | * | ||||||||
* If a program mistakenly defines _ANSI_SOURCE and some other macro such as | * If a program mistakenly defines _ANSI_SOURCE and some other macro such as | ||||||||
* _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). | ||||||||
▲ Show 20 Lines • Show All 169 Lines • Show Last 20 Lines |