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