1
0
mirror of http://mpg123.de/trunk/.git synced 2025-07-31 13:24:22 +03:00

Add new preprocessor flags to disable error / warning messages.

That can save around 9K on libmpg123.



git-svn-id: svn://scm.orgis.org/mpg123/trunk@1800 35dc7657-300d-0410-a2e5-dc2837fedb53
This commit is contained in:
thor
2009-01-10 16:38:05 +00:00
parent 780b02c7ef
commit d1c9be757b
2 changed files with 67 additions and 4 deletions

View File

@ -38,10 +38,14 @@ print "#else\n";
printdefs(0);
print "#endif\n";
for('warning', 'error', 'ereturn')
foreach my $t ('warning', 'error', 'ereturn')
{
print "\n/* $_ macros also here... */\n";
printdefs(1, $_);
print "\n/* $t macros also here... */\n";
print "#ifndef NO_".uc($t)."\n";
printdefs(1, $t);
print "#else\n";
printdefs(0, $t);
print "#endif\n";
}
sub printdefs
@ -51,11 +55,13 @@ sub printdefs
$type = 'debug' unless defined $type;
my $i;
my $pre = ''; my $post = ''; my $rv = '';
my $notreal = '';
if($type eq 'ereturn')
{
$pre = 'do{ ';
$post = '; return rv; }while(0)';
$rv = 'rv, ';
$notreal = 'return rv';
}
while(++$i <= $num+1)
{
@ -66,7 +72,7 @@ sub printdefs
print join(', ', @args).') ';
if($forreal){ print $pre.'fprintf(stderr, "[" __FILE__ ":%i] '.$type.': " s "\n", __LINE__'.join(', ', @args).")$post\n"; }
#else{ print "do {} while(0)\n"; }
else{ print "\n"; }
else{ print "$notreal\n"; }
}
}