Skip to content

Commit

Permalink
[Bug #20524] win32: Suppress GMP warning
Browse files Browse the repository at this point in the history
```
C:\vcpkg\installed\x64-windows\include\gmp.h(2237): warning C4146: unary minus operator applied to unsigned type, result still unsigned
```
  • Loading branch information
nobu committed Jun 5, 2024
1 parent d7e558e commit f8e3dd4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
12 changes: 9 additions & 3 deletions bignum.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
# define USE_GMP 0
#endif
#endif
#if USE_GMP
# include <gmp.h>
#endif

#include "id.h"
#include "internal.h"
Expand All @@ -48,6 +45,15 @@
#include "ruby/util.h"
#include "ruby_assert.h"

#if USE_GMP
RBIMPL_WARNING_PUSH()
# ifdef _MSC_VER
RBIMPL_WARNING_IGNORED(4146) /* for mpn_neg() */
# endif
# include <gmp.h>
RBIMPL_WARNING_POP()
#endif

static const bool debug_integer_pack = (
#ifdef DEBUG_INTEGER_PACK
DEBUG_INTEGER_PACK+0
Expand Down
12 changes: 9 additions & 3 deletions rational.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
# define USE_GMP 0
#endif
#endif
#if USE_GMP
#include <gmp.h>
#endif

#include "id.h"
#include "internal.h"
Expand All @@ -36,6 +33,15 @@
#include "internal/rational.h"
#include "ruby_assert.h"

#if USE_GMP
RBIMPL_WARNING_PUSH()
# ifdef _MSC_VER
RBIMPL_WARNING_IGNORED(4146) /* for mpn_neg() */
# endif
# include <gmp.h>
RBIMPL_WARNING_POP()
#endif

#define ZERO INT2FIX(0)
#define ONE INT2FIX(1)
#define TWO INT2FIX(2)
Expand Down

0 comments on commit f8e3dd4

Please sign in to comment.