json 2.7.2 → 2.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,32 +1,12 @@
1
- # frozen_string_literal: false
1
+ # frozen_string_literal: true
2
2
  require 'mkmf'
3
3
 
4
- have_func("rb_enc_raise", "ruby.h")
5
- have_func("rb_enc_interned_str", "ruby.h")
4
+ have_func("rb_enc_interned_str", "ruby.h") # RUBY_VERSION >= 3.0
5
+ have_func("rb_hash_new_capa", "ruby.h") # RUBY_VERSION >= 3.2
6
+ have_func("rb_hash_bulk_insert", "ruby.h") # Missing on TruffleRuby
7
+ have_func("rb_category_warn", "ruby.h") # Missing on TruffleRuby
8
+ have_func("strnlen", "string.h") # Missing on Solaris 10
6
9
 
7
- # checking if String#-@ (str_uminus) dedupes... '
8
- begin
9
- a = -(%w(t e s t).join)
10
- b = -(%w(t e s t).join)
11
- if a.equal?(b)
12
- $CFLAGS << ' -DSTR_UMINUS_DEDUPE=1 '
13
- else
14
- $CFLAGS << ' -DSTR_UMINUS_DEDUPE=0 '
15
- end
16
- rescue NoMethodError
17
- $CFLAGS << ' -DSTR_UMINUS_DEDUPE=0 '
18
- end
19
-
20
- # checking if String#-@ (str_uminus) directly interns frozen strings... '
21
- begin
22
- s = rand.to_s.freeze
23
- if (-s).equal?(s) && (-s.dup).equal?(s)
24
- $CFLAGS << ' -DSTR_UMINUS_DEDUPE_FROZEN=1 '
25
- else
26
- $CFLAGS << ' -DSTR_UMINUS_DEDUPE_FROZEN=0 '
27
- end
28
- rescue NoMethodError
29
- $CFLAGS << ' -DSTR_UMINUS_DEDUPE_FROZEN=0 '
30
- end
10
+ append_cflags("-std=c99")
31
11
 
32
12
  create_makefile 'json/ext/parser'