summaryrefslogtreecommitdiff
path: root/ext/psych/emitter.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-20 07:18:04 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-20 07:18:04 +0000
commitdf45be0472a8bb87e1a7fb10f19cb7f35fd6e8e2 (patch)
tree81b3fa05ac4cb26ad341bc9f3d9decb7d0c95fb2 /ext/psych/emitter.c
parent5256d1026505b01f75669c1087c74c04dacd05ba (diff)
* ext/psych/emitter: f..king C99(gcc)-ism.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/psych/emitter.c')
-rw-r--r--ext/psych/emitter.c10
1 files changed, 8 insertions, 2 deletions
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);