From: Youhei SASAKI <uwabami@gfd-dennou.org>
Date: Fri, 1 Jun 2012 18:57:48 +0900
Subject: Update Cogen for Ruby1.9.2

Signed-off-by: Youhei SASAKI <uwabami@gfd-dennou.org>
---
 cogen.rb |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/cogen.rb b/cogen.rb
index 2494f5f..15c4174 100644
--- a/cogen.rb
+++ b/cogen.rb
@@ -120,6 +120,10 @@ def pgfuncgen(name, inp, out)
     retn = "rb_ary_new3(#{nout},"+retn.join(",")+")"
   end
 
+  unless retn.class == String
+    retn = retn.join(" ")
+  end
+
   prot = prot.join(",")
   pass = pass.join(",")
 
@@ -127,7 +131,7 @@ def pgfuncgen(name, inp, out)
 static VALUE
   rb_pgplot_#{name}(#{prot})
 {
-  #{vars}
+  #{vars.join(" ")}
   c#{name}(#{pass});
   return #{retn};
 }
@@ -143,8 +147,8 @@ def cogen_pgplot
       $pgfuncs.each{|x| fout.print pgfuncgen(*x)}
     elsif /--- auto-generated defs will be placed here ---/  =~ l
       $pgfuncs.each{|x|
-	n = x[1].split(",").size
-	fout.print "  rb_define_module_function(mPgplot,\"#{x[0]}\",rb_pgplot_#{x[0]},#{n});\n"}
+        n = x[1].split(",").size
+        fout.print "  rb_define_module_function(mPgplot,\"#{x[0]}\",rb_pgplot_#{x[0]},#{n});\n"}
     else
       fout.print
     end
