Skip to content

Commit 0092988

Browse files
committed
crypto: only include gmp.h on MSVC to disable the warning, add a comment explaining why
1 parent 5e536bc commit 0092988

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/engine/qcommon/crypto.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2727
#include "q_shared.h"
2828
#include "qcommon.h"
2929

30+
/* The Nettle headers include the GMP header, this disables the warning
31+
on GMP alone, not the whole Nettle. We don't use GMP directly ourselves. */
32+
#if defined(_MSC_VER)
3033
#pragma warning(push)
3134
#pragma warning(disable : 4146) // "unary minus operator applied to unsigned type, result still unsigned"
3235
#include <gmp.h>
3336
#pragma warning(pop)
37+
#endif
3438

3539
#include <nettle/bignum.h>
3640
#include <nettle/rsa.h>

0 commit comments

Comments
 (0)