diff --git a/ext/json/ext/parser/extconf.rb b/ext/json/ext/parser/extconf.rb index a9d740c7..bd537c9c 100644 --- a/ext/json/ext/parser/extconf.rb +++ b/ext/json/ext/parser/extconf.rb @@ -8,6 +8,31 @@ have_func("rb_hash_bulk_insert", "ruby.h") # Missing on TruffleRuby have_func("ruby_xfree_sized", "ruby.h") # RUBY_VERSION >= 4.1 +def have_builtin_func(name, check_expr, opt = "", &b) + checking_for checking_message(name.funcall_style, nil, opt) do + if try_compile(<= 3.3 end diff --git a/ext/json/ext/vendor/fast_float_parser.h b/ext/json/ext/vendor/fast_float_parser.h index 66e1b132..67bc6900 100644 --- a/ext/json/ext/vendor/fast_float_parser.h +++ b/ext/json/ext/vendor/fast_float_parser.h @@ -707,6 +707,12 @@ static inline double ffp_bits2double(uint64_t bits) { return d; } +#if defined(__x86_64__) && defined(HAVE_X86INTRIN_H) +# include +#elif defined(_MSC_VER) && defined(HAVE_INTRIN_H) +# include +#endif + static inline unsigned int ffc_nlz_int64(uint64_t x) {