From 0bdff401ca75d85490db621be367c80068e8e448 Mon Sep 17 00:00:00 2001 From: jj Date: Tue, 3 Jul 2012 14:12:32 +0200 Subject: [PATCH] ruby: fix codegen align int64_t on windows --- plugins/ruby/codegen.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/ruby/codegen.pl b/plugins/ruby/codegen.pl index 1fcebfffe..67b86f835 100755 --- a/plugins/ruby/codegen.pl +++ b/plugins/ruby/codegen.pl @@ -516,7 +516,9 @@ sub get_field_align { if ($meta eq 'number') { $al = $field->getAttribute('ld:bits')/8; - $al = 4 if $al > 4; + # linux aligns int64_t to 4, windows to 8 + # floats are 4 bytes so no pb + $al = 4 if ($al > 4 and ($os eq 'linux' or $al != 8)); } elsif ($meta eq 'global') { $al = get_global_align($field); } elsif ($meta eq 'compound') {