From: Jean Boussier Date: Mon, 28 Apr 2025 14:15:36 +0000 (+0200) Subject: [ruby/json] Fix i686 builds X-Git-Url: https://repo.or.cz/ruby.git/commitdiff_plain/338adad8ba0c1f61cb9a86612a35448213e90f74 [ruby/json] Fix i686 builds We should test compilation with `-msse2` because we need to test with whatever arguments Ruby will be compiled with. https://github.com/ruby/json/commit/0a871365db --- diff --git a/ext/json/generator/extconf.rb b/ext/json/generator/extconf.rb index 4fbeb5f33f..374f95a1af 100644 --- a/ext/json/generator/extconf.rb +++ b/ext/json/generator/extconf.rb @@ -22,7 +22,7 @@ else end end - if have_header('x86intrin.h') && have_type('__m128i', headers=['x86intrin.h']) && try_compile(<<~'SRC', opt='-msse2') + if have_header('x86intrin.h') && have_type('__m128i', headers=['x86intrin.h']) && try_compile(<<~'SRC') #include int main() { __m128i test = _mm_set1_epi8(32); diff --git a/ext/json/generator/generator.c b/ext/json/generator/generator.c index 3112ef1a44..536c2aa1b7 100644 --- a/ext/json/generator/generator.c +++ b/ext/json/generator/generator.c @@ -117,9 +117,9 @@ typedef struct _search_state { const char *chunk_end; bool has_matches; -#ifdef HAVE_SIMD_NEON +#if defined(HAVE_SIMD_NEON) uint64_t matches_mask; -#elif HAVE_SIMD_SSE2 +#elif defined(HAVE_SIMD_SSE2) int matches_mask; #else #error "Unknown SIMD Implementation."