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
|
|
|
|
$unifdef0 =~ s/\n$//;
|
|
$unifdef0 =~ s/^/-U/;
|
|
$unifdef0 =~ s/\n/\n-U/g;
|
|
$unifdef0 =~ s/\n/ /g;
|
|
$unifdef0 =~ join("\n", $unifdef);
|
|
$unifdef1 =~ s/\n$//;
|
|
$unifdef1 =~ s/^/-D/;
|
|
$unifdef1 =~ s/\n/\n-D/g;
|
|
$unifdef1 =~ s/\n/ /g;
|
|
$unifdef1 =~ join("\n", $unifdef);
|
|
$unifdef = $unifdef0 . ' ' . $unifdef1;
|
|
$unifdef = $unifdef0;
|
|
|
|
$files = `find . -name \\\*.h -type f -print | grep -v MacOS`;
|
|
foreach $i (split(/[\n ]/, $files)) {
|
|
print "echo $i\n";
|
|
print "unifdef $unifdef <$i >$tmp\n";
|
|
print "mv $tmp $i\n";
|
|
}
|