# HG changeset patch # User anatofuz # Date 1575333153 -32400 # Node ID f103beea19f4ad5c1d779d0c24fd6114ed65b735 # Parent 53be0626c3fa16e1c8ce393e7598164c995f8f24# Parent 004e825f37c71bd34e3cf1b86c394ea7719355b4 tweak diff -r 53be0626c3fa -r f103beea19f4 src/gearsTools/trans_impl.pl --- a/src/gearsTools/trans_impl.pl Tue Dec 03 09:31:42 2019 +0900 +++ b/src/gearsTools/trans_impl.pl Tue Dec 03 09:32:33 2019 +0900 @@ -21,18 +21,17 @@ my $output_file = $impl_file; $output_file =~ s/\.h/.cbc/; -open my $fh, '>', $output_file; -my $stdout = $fh; +my $stdout = *STDOUT; -unless ($opt{w}) { - $stdout = *STDOUT; +if ($opt{w}) { + open $stdout, '>', $output_file; } emit_include_part($stdout, $inter_ir->{name}); emit_impl_header_in_comment($stdout, $impl_file); emit_constracutor($stdout,$impl_ir,$inter_ir); emit_code_gears($stdout,$impl_ir,$inter_ir); -close $fh; +close $stdout; sub emit_include_part { my ($out, $interface) = @_;