Skip to content

Commit a052d96

Browse files
byroothsbt
authored andcommitted
[ruby/json] Compile with std=c99
ruby/json@d4968d2e48
1 parent cbd933b commit a052d96

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

ext/json/generator/extconf.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# The pure-Ruby generator is faster on TruffleRuby, so skip compiling the generator extension
55
File.write('Makefile', dummy_makefile("").join)
66
else
7+
append_cflags("-std=c99")
78
$defs << "-DJSON_GENERATOR"
89
create_makefile 'json/ext/generator'
910
end

ext/json/generator/generator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ static void convert_UTF8_to_ASCII_only_JSON(FBuffer *out_buffer, VALUE str, cons
257257
}
258258

259259
for (short i = 1; i < ch_len; i++) {
260-
wchar = (wchar<<6) | (ptr[pos+i] & 0x3F);
260+
wchar = (wchar << 6) | (ptr[pos+i] & 0x3F);
261261
}
262262

263263
FLUSH_POS(ch_len);

ext/json/parser/extconf.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,6 @@
2929
$CFLAGS << ' -DSTR_UMINUS_DEDUPE_FROZEN=0 '
3030
end
3131

32+
append_cflags("-std=c99")
33+
3234
create_makefile 'json/ext/parser'

0 commit comments

Comments
 (0)