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

now also warnings and error messages as macro

git-svn-id: svn://scm.orgis.org/mpg123/trunk@337 35dc7657-300d-0410-a2e5-dc2837fedb53
This commit is contained in:
thor
2006-08-05 14:55:26 +00:00
parent 3166029610
commit a501c23941
2 changed files with 48 additions and 13 deletions

View File

@ -38,18 +38,27 @@ print "#else\n";
printdefs(0);
print "#endif\n";
for('warning', 'error')
{
print "\n/* $_ macros also here... */\n";
printdefs(1, $_);
}
sub printdefs
{
my $forreal = shift;
my $type = shift;
$type = 'debug' unless defined $type;
my $i;
while(++$i <= $num+1)
{
my @args, my $j;
while(++$j < $i){ push(@args, chr(ord('a')+$j-1)); }
unshift(@args, '') if(@args);
print ' #define debug'.($i > 1 ? ($i-1) : '').'(s';
print ' #define '.$type.($i > 1 ? ($i-1) : '').'(s';
print join(', ', @args).') ';
if($forreal){ print 'fprintf(stderr, "[" __FILE__ ":%i] " s "\n", __LINE__'.join(', ', @args).")\n"; }
if($forreal){ print 'fprintf(stderr, "[" __FILE__ ":%i] '.$type.': " s "\n", __LINE__'.join(', ', @args).")\n"; }
else{ print "{}\n"; }
}
}