[winpr,api] add C23 [[deprecated]] support

* Support C23 attributes for WINPR_DEPRECATED* macros
* Support C23 attributes for WINPR_NORETURN macro
This commit is contained in:
akallabeth 2023-08-25 11:58:45 +02:00 committed by akallabeth
parent 9cee9b3c08
commit 786279fd9f

View File

@ -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