diff --git a/ChangeLog b/ChangeLog index 7df46b0b1a..5dbc4df3da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu May 20 16:17:14 2010 NAKAMURA Usaku + + * ext/psych/emitter: C99(gcc)-ism. + Thu May 20 12:59:49 2010 Aaron Patterson * ext/psych/lib/psych/stream.rb: adding YAML streaming API for diff --git a/ext/psych/emitter.c b/ext/psych/emitter.c index ad1fe36d35..0400f7e9ba 100644 --- a/ext/psych/emitter.c +++ b/ext/psych/emitter.c @@ -207,12 +207,15 @@ static VALUE scalar( ) { yaml_emitter_t * emitter; yaml_event_t event; +#ifdef HAVE_RUBY_ENCODING_H + rb_encoding *encoding; +#endif Data_Get_Struct(self, yaml_emitter_t, emitter); Check_Type(value, T_STRING); #ifdef HAVE_RUBY_ENCODING_H - rb_encoding * encoding = rb_utf8_encoding(); + encoding = rb_utf8_encoding(); value = rb_str_export_to_enc(value, encoding); @@ -324,10 +327,13 @@ static VALUE start_mapping( ) { yaml_emitter_t * emitter; yaml_event_t event; +#ifdef HAVE_RUBY_ENCODING_H + rb_encoding *encoding; +#endif Data_Get_Struct(self, yaml_emitter_t, emitter); #ifdef HAVE_RUBY_ENCODING_H - rb_encoding * encoding = rb_utf8_encoding(); + encoding = rb_utf8_encoding(); if(!NIL_P(anchor)) { Check_Type(anchor, T_STRING);