From 5d14effc162f05d4e26a1de08772bff9d4a190e8 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Thu, 4 Sep 2025 00:33:34 +0200 Subject: [PATCH] crypto: only include gmp.h on MSVC to disable the warning, add a comment explaining why --- src/engine/qcommon/crypto.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/engine/qcommon/crypto.h b/src/engine/qcommon/crypto.h index 1619e56326..bed6fac909 100644 --- a/src/engine/qcommon/crypto.h +++ b/src/engine/qcommon/crypto.h @@ -27,10 +27,14 @@ along with this program. If not, see . #include "q_shared.h" #include "qcommon.h" +/* The Nettle headers include the GMP header, this disables the warning +on GMP alone, not the whole Nettle. We don't use GMP directly ourselves. */ +#if defined(_MSC_VER) #pragma warning(push) #pragma warning(disable : 4146) // "unary minus operator applied to unsigned type, result still unsigned" #include #pragma warning(pop) +#endif #include #include