Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/engine/qcommon/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#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 <gmp.h>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Nettle headers include the GMP header. So this may be here just for the warning fix. You could get rid of the GMP include but the MSVC warning adjustment would still need to be used for the Nettle headers.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified the commit to only include GMP on MSVC for the purpose of disabling the warning, and added a comment explaining why we do that.

#pragma warning(pop)
#endif

#include <nettle/bignum.h>
#include <nettle/rsa.h>
Expand Down