Debian Codegraph @

Preproc/xsubppfix

raw
1 #!/usr/bin/perl -w
2 #
3 # Copyright 2008-2024 by Wilson Snyder. This program is free software;
4 # you can redistribute it and/or modify it under the terms of either the GNU
5 # Lesser General Public License Version 3 or the Perl Artistic License Version 2.0.
6 #
7 ######################################################################
8
9 # DESCRIPTION: Edits xsubpp output to get around various issues.
10
11 foreach my $line (<STDIN>) {
12 # Fix xsubpp 1.9508 and GCC 4.2.1 warning
13 # "warning: deprecated conversion from string constant to ‘char*’"
14 $line =~ s/^(\s*)(?:const\s*|)char\*\s*file\s*=\s*__FILE__;/${1}char* file = (char*)__FILE__;/;
15 if ($line =~ /newXSproto/) {
16 $line =~ s/([(,]\s*)"/$1(char*)"/g;
17 }
18 #
19 print "$line";
20 }