From 786279fd9faee4c5b9169db2c5cb6d37cc02dd58 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Fri, 25 Aug 2023 11:58:45 +0200 Subject: [PATCH] [winpr,api] add C23 [[deprecated]] support * Support C23 attributes for WINPR_DEPRECATED* macros * Support C23 attributes for WINPR_NORETURN macro --- winpr/include/winpr/winpr.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/winpr/include/winpr/winpr.h b/winpr/include/winpr/winpr.h index 77046f464..18c640a81 100644 --- a/winpr/include/winpr/winpr.h +++ b/winpr/include/winpr/winpr.h @@ -47,7 +47,11 @@ #define WINPR_API #endif -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(__STDC__) && 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 +#elif defined(WIN32) && !defined(__CYGWIN__) #define WINPR_DEPRECATED(obj) __declspec(deprecated) obj #define WINPR_DEPRECATED_VAR(text, obj) __declspec(deprecated(text)) obj #define WINPR_NORETURN(obj) __declspec(noreturn) obj