summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNARUSE, Yui <naruse@airemix.jp>2025-11-17 21:38:51 +0900
committerNARUSE, Yui <naruse@airemix.jp>2025-11-17 21:39:04 +0900
commit4fa6e9938cfb9458abd876ad4219a6648bfe1c96 (patch)
treea193709f1f4077a7094f384c955cc94a84bb0596
parent3bbd45dd86ba7a00319ba482bd09b15fc86b7466 (diff)
strnlen is not used nowv4.0.0-preview2
-rw-r--r--ext/json/parser/extconf.rb1
-rw-r--r--ext/json/parser/parser.c9
2 files changed, 0 insertions, 10 deletions
diff --git a/ext/json/parser/extconf.rb b/ext/json/parser/extconf.rb
index cda385767c..079b37382d 100644
--- a/ext/json/parser/extconf.rb
+++ b/ext/json/parser/extconf.rb
@@ -6,7 +6,6 @@ have_func("rb_enc_interned_str", "ruby/encoding.h") # RUBY_VERSION >= 3.0
have_func("rb_str_to_interned_str", "ruby.h") # RUBY_VERSION >= 3.0
have_func("rb_hash_new_capa", "ruby.h") # RUBY_VERSION >= 3.2
have_func("rb_hash_bulk_insert", "ruby.h") # Missing on TruffleRuby
-have_func("strnlen", "string.h") # Missing on Solaris 10
append_cflags("-std=c99")
diff --git a/ext/json/parser/parser.c b/ext/json/parser/parser.c
index 9df04ce007..2bf3ae0eb3 100644
--- a/ext/json/parser/parser.c
+++ b/ext/json/parser/parser.c
@@ -296,15 +296,6 @@ static void rvalue_stack_eagerly_release(VALUE handle)
}
}
-
-#ifndef HAVE_STRNLEN
-static size_t strnlen(const char *s, size_t maxlen)
-{
- char *p;
- return ((p = memchr(s, '\0', maxlen)) ? p - s : maxlen);
-}
-#endif
-
static int convert_UTF32_to_UTF8(char *buf, uint32_t ch)
{
int len = 1;