[winpr] add WINPR_PRAGMA_WARNING

a compiler independent version of #warning
This commit is contained in:
akallabeth 2024-10-16 11:28:43 +02:00
parent 0b65bf5ba8
commit 32169be68e
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5

View File

@ -22,6 +22,15 @@
#include <stdlib.h>
#define WINPR_DO_PRAGMA(x) _Pragma(#x)
#if defined(__GNUC__)
#define WINPR_PRAGMA_WARNING(msg) WINPR_DO_PRAGMA(GCC warning #msg)
#elif defined(__clang__)
#define WINPR_PRAGMA_WARNING(msg) WINPR_DO_PRAGMA(GCC warning #msg)
#elif defined(_MSC_VER)
#define WINPR_PRAGMA_WARNING(msg) WINPR_DO_PRAGMA(message \x28 #msg \x29)
#endif
#if defined(__clang__)
#define WINPR_PRAGMA_DIAG_PUSH _Pragma("clang diagnostic push")
#define WINPR_PRAGMA_DIAG_IGNORED_OVERLENGTH_STRINGS \