From 0a871365db420ef056546545c13a069fd28ae17c Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Mon, 28 Apr 2025 16:15:36 +0200 Subject: [PATCH] Fix i686 builds We should test compilation with `-msse2` because we need to test with whatever arguments Ruby will be compiled with. --- ext/json/ext/generator/extconf.rb | 2 +- ext/json/ext/generator/generator.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/json/ext/generator/extconf.rb b/ext/json/ext/generator/extconf.rb index 4fbeb5f3..374f95a1 100644 --- a/ext/json/ext/generator/extconf.rb +++ b/ext/json/ext/generator/extconf.rb @@ -22,7 +22,7 @@ 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/ext/generator/generator.c b/ext/json/ext/generator/generator.c index 3112ef1a..536c2aa1 100644 --- a/ext/json/ext/generator/generator.c +++ b/ext/json/ext/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."