[ruby/json] Compile with std=c99

https://github.com/ruby/json/commit/d4968d2e48
This commit is contained in:
Jean Boussier 2024-10-19 20:44:33 +02:00 committed by Hiroshi SHIBATA
parent cbd933bcf1
commit a052d96103
3 changed files with 4 additions and 1 deletions

View File

@ -4,6 +4,7 @@ if RUBY_ENGINE == 'truffleruby'
# The pure-Ruby generator is faster on TruffleRuby, so skip compiling the generator extension
File.write('Makefile', dummy_makefile("").join)
else
append_cflags("-std=c99")
$defs << "-DJSON_GENERATOR"
create_makefile 'json/ext/generator'
end

View File

@ -257,7 +257,7 @@ static void convert_UTF8_to_ASCII_only_JSON(FBuffer *out_buffer, VALUE str, cons
}
for (short i = 1; i < ch_len; i++) {
wchar = (wchar<<6) | (ptr[pos+i] & 0x3F);
wchar = (wchar << 6) | (ptr[pos+i] & 0x3F);
}
FLUSH_POS(ch_len);

View File

@ -29,4 +29,6 @@ rescue NoMethodError
$CFLAGS << ' -DSTR_UMINUS_DEDUPE_FROZEN=0 '
end
append_cflags("-std=c99")
create_makefile 'json/ext/parser'