[winpr,macros] Remove check for _STDC_, check only __STDC_VERSION__

This commit is contained in:
akallabeth
2024-10-16 19:59:28 +02:00
parent 96730a0be5
commit 122aa76ef1
3 changed files with 5 additions and 5 deletions

View File

@@ -69,9 +69,9 @@ extern "C"
#define WINPR_STATIC_ASSERT(cond) static_assert(cond)
#elif defined(__cplusplus) && (__cplusplus >= 201103L) // C++ 11
#define WINPR_STATIC_ASSERT(cond) static_assert(cond, #cond)
#elif defined(__STDC__) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L) // C23
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L) // C23
#define WINPR_STATIC_ASSERT(cond) static_assert(cond)
#elif defined(__STDC__) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) // C11
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) // C11
#define WINPR_STATIC_ASSERT(cond) _Static_assert(cond, #cond)
#else
WINPR_PRAGMA_WARNING("static-assert macro not supported on this platform")

View File

@@ -32,7 +32,7 @@
#endif
// C99 related macros
#if defined(__STDC__) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
#define WINPR_RESTRICT restrict
#elif defined(_MSC_VER) && _MSC_VER >= 1900
#define WINPR_RESTRICT __restrict
@@ -41,7 +41,7 @@
#endif
// C23 related macros
#if defined(__STDC__) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
#define WINPR_FALLTHROUGH \
(void)0; \
[[fallthrough]];

View File

@@ -65,7 +65,7 @@
#define WINPR_FORMAT_ARG _Printf_format_string_
#endif
#if defined(__STDC__) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)
#define WINPR_DEPRECATED(obj) [[deprecated]] obj
#define WINPR_DEPRECATED_VAR(text, obj) [[deprecated(text)]] obj
#define WINPR_NORETURN(obj) [[noreturn]] obj