diff --git a/codegen.pl b/codegen.pl index 1519712b1..874fdedd9 100755 --- a/codegen.pl +++ b/codegen.pl @@ -22,6 +22,8 @@ BEGIN use StructFields; use StructType; +my $errorlevel = 0; + my $input_dir = $ARGV[0] || '.'; my $output_dir = $ARGV[1] || 'codegen'; @@ -75,6 +77,7 @@ BEGIN }; if ($@) { print "Error preprocessing type $typename: ".$@; + $errorlevel++; } } @@ -94,6 +97,7 @@ BEGIN }; if ($@) { print 'Error: '.$@."Type $typename in $filename ignored\n"; + $errorlevel++; } } @@ -126,6 +130,7 @@ BEGIN }; if ($@) { print 'Error: '.$@."Global $typename in $filename failed\n"; + $errorlevel++; } } } "namespace global "; @@ -243,3 +248,5 @@ sub replace_file { } } } + +exit $errorlevel;