From 1a38c727630539a3df09b04ecf4b1ce8f1e25014 Mon Sep 17 00:00:00 2001 From: jj Date: Wed, 24 Sep 2014 23:37:25 +0200 Subject: [PATCH] ruby: add stl-fstream to codegen --- plugins/ruby/codegen.pl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/ruby/codegen.pl b/plugins/ruby/codegen.pl index f04731e3b..8a670718e 100755 --- a/plugins/ruby/codegen.pl +++ b/plugins/ruby/codegen.pl @@ -595,6 +595,9 @@ sub get_field_align { $al = get_field_align($tg); } elsif ($meta eq 'bytes') { $al = $field->getAttribute('alignment') || 1; + } elsif ($meta eq 'primitive') { + my $subtype = $field->getAttribute('ld:subtype'); + if ($subtype eq 'stl-fstream' and $os eq 'windows') { $al = 8; } } return $al; @@ -735,6 +738,14 @@ sub sizeof { print "sizeof stl-string on $os\n"; } print "sizeof stl-string\n"; + } elsif ($subtype eq 'stl-fstream') { if ($os eq 'linux') { + return 284; + } elsif ($os eq 'windows') { + return 184; + } else { + print "sizeof stl-fstream on $os\n"; + } + print "sizeof stl-fstream\n"; } else { print "sizeof primitive $subtype\n"; } @@ -1011,6 +1022,7 @@ sub render_item_primitive { my $subtype = $item->getAttribute('ld:subtype'); if ($subtype eq 'stl-string') { push @lines_rb, "stl_string"; + } elsif ($subtype eq 'stl-fstream') { } else { print "no render primitive $subtype\n"; }