From c2315570e08f52149c6c3878311aea661b9193ca Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 3 Dec 2021 09:17:19 +0100 Subject: [PATCH] api: header: silence MSVC warnings for MSVC only MinGW ignores unknown `#pragma warning` lines, but displays a warning nevertheless. Signed-off-by: Simon Rozman --- api/wintun.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/api/wintun.h b/api/wintun.h index 6b7e0da..bcf5ccc 100644 --- a/api/wintun.h +++ b/api/wintun.h @@ -30,8 +30,10 @@ extern "C" { # define _Post_maybenull_ #endif -#pragma warning(push) -#pragma warning(disable : 4324) /* structure was padded due to alignment specifier */ +#if defined(_MSC_VER) +# pragma warning(push) +# pragma warning(disable : 4324) /* structure was padded due to alignment specifier */ +#endif /** * A handle representing Wintun adapter @@ -263,7 +265,9 @@ BYTE *(WINAPI WINTUN_ALLOCATE_SEND_PACKET_FUNC)(_In_ WINTUN_SESSION_HANDLE Sessi */ typedef VOID(WINAPI WINTUN_SEND_PACKET_FUNC)(_In_ WINTUN_SESSION_HANDLE Session, _In_ const BYTE *Packet); -#pragma warning(pop) +#if defined(_MSC_VER) +# pragma warning(pop) +#endif #ifdef __cplusplus }