[ruby/json] Fix i686 builds
authorJean Boussier <[email protected]>
Mon, 28 Apr 2025 14:15:36 +0000 (28 16:15 +0200)
committerJean Boussier <[email protected]>
Wed, 30 Apr 2025 06:12:41 +0000 (30 08:12 +0200)
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

ext/json/generator/extconf.rb
ext/json/generator/generator.c

index 4fbeb5f..374f95a 100644 (file)
@@ -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 <x86intrin.h>
       int main() {
           __m128i test = _mm_set1_epi8(32);
index 3112ef1..536c2aa 100644 (file)
@@ -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."