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:
@ -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"; }
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user