diff --git a/src/json.hpp b/src/json.hpp
index 9312c4f4..f66d0b59 100644
--- a/src/json.hpp
+++ b/src/json.hpp
@@ -8498,13 +8498,13 @@ basic_json_parser_63:
             if (*curptr == '-')
             {
                 type = value_t::number_integer;
-                max = static_cast<uint64_t>(std::numeric_limits<number_integer_t>::max()) + 1;
+                max = static_cast<uint64_t>((std::numeric_limits<number_integer_t>::max)()) + 1;
                 curptr++;
             }
             else
             {
                 type = value_t::number_unsigned;
-                max = static_cast<uint64_t>(std::numeric_limits<number_unsigned_t>::max());
+                max = static_cast<uint64_t>((std::numeric_limits<number_unsigned_t>::max()));
             }
 
             // count the significant figures
diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c
index 2ab300ec..f893aac0 100644
--- a/src/json.hpp.re2c
+++ b/src/json.hpp.re2c
@@ -7808,13 +7808,13 @@ class basic_json
             if (*curptr == '-')
             {
                 type = value_t::number_integer;
-                max = static_cast<uint64_t>(std::numeric_limits<number_integer_t>::max()) + 1;
+                max = static_cast<uint64_t>((std::numeric_limits<number_integer_t>::max)()) + 1;
                 curptr++;
             }
             else
             {
                 type = value_t::number_unsigned;
-                max = static_cast<uint64_t>(std::numeric_limits<number_unsigned_t>::max());
+                max = static_cast<uint64_t>((std::numeric_limits<number_unsigned_t>::max()));
             }
 
             // count the significant figures