X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=tools%2Fremove_cpp_comands.perl;h=f9a7c493fa81ac3f0f892c55c3d7cb1a5fd49fe9;hb=9b23a130beb15ad7eac348a9e98108892a11f0a5;hp=56a8c2a240892ba8d059792bdd5538dd0b08da55;hpb=1a09f25603172665322612b51760898e54d13530;p=libfirm diff --git a/tools/remove_cpp_comands.perl b/tools/remove_cpp_comands.perl index 56a8c2a24..f9a7c493f 100644 --- a/tools/remove_cpp_comands.perl +++ b/tools/remove_cpp_comands.perl @@ -62,19 +62,34 @@ $scndlastline = ""; $lastline = ""; $eat = 0; +$multiline = 0; foreach $line (@lines) { if ($line =~ /\#ifdef __cplusplus/) { -# There is extern "C" in firm.h, guarded by #ifdef __cplusplus +# There is extern "C" in some header files guarded by #ifdef __cplusplus # crecoder does not grok the extern "C", so remove thses three lines. $eat = 2; } elsif ($eat > 0) { $eat = $eat -1; - } elsif (($line =~ /^\#/) ) { + } elsif ($line =~ /wchar_t/) { + # of course crecoder cannot handle wchar_t, what else? + } elsif ($multiline > 0) { + # this line connects a previous one, kill it + if ($line =~ /\\$/) { + $multiline = 1; + } else { + $multiline = 0; + } + } elsif ($line =~ /^\#/) { # eat the line $scndlastline = $lastline; $lastline = $line; + if ($line =~ /\\$/) { + $multiline = 1; + } else { + $multiline = 0; + } } elsif ($openbracket == 1) { print TDF "$line"; if ((index($line, "}") > -1)) {