summaryrefslogtreecommitdiff
path: root/lib/ExtUtils/xsubpp
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-03-12 00:51:08 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-03-12 00:51:08 +0000
commit01f988be05578e1f4609174755be9d7b61543c58 (patch)
tree7ebcceb4314c8b249ec6cc249e699dc385acd199 /lib/ExtUtils/xsubpp
parent3bd495df69b982704c59fc1ecbed71e5112e7da0 (diff)
downloadperl-01f988be05578e1f4609174755be9d7b61543c58.tar.gz
[asperl] added AS patch#12 with minor changes
p4raw-id: //depot/asperl@806
Diffstat (limited to 'lib/ExtUtils/xsubpp')
-rwxr-xr-xlib/ExtUtils/xsubpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/ExtUtils/xsubpp b/lib/ExtUtils/xsubpp
index b8ec042b41..58b3a08705 100755
--- a/lib/ExtUtils/xsubpp
+++ b/lib/ExtUtils/xsubpp
@@ -83,6 +83,8 @@ require 5.002;
use Cwd;
use vars '$cplusplus';
+use Config;
+
sub Q ;
# Global Constants
@@ -103,6 +105,8 @@ $FH = 'File0000' ;
$usage = "Usage: xsubpp [-v] [-C++] [-except] [-prototypes] [-noversioncheck] [-nolinenumbers] [-s pattern] [-typemap typemap]... file.xs\n";
$proto_re = "[" . quotemeta('\$%&*@;') . "]" ;
+# mjn
+$OBJ = 1 if $Config{'ccflags'} =~ /PERL_OBJECT/i;
$except = "";
$WantPrototypes = -1 ;
@@ -714,6 +718,10 @@ print("#line 1 \"$filename\"\n")
while (<$FH>) {
last if ($Module, $Package, $Prefix) =
/^MODULE\s*=\s*([\w:]+)(?:\s+PACKAGE\s*=\s*([\w:]+))?(?:\s+PREFIX\s*=\s*(\S+))?\s*$/;
+
+ if ($OBJ) {
+ s/#if(?:def|\s+defined)\s+(\(__cplusplus\)|__cplusplus)/#if defined(__cplusplus) && !defined(PERL_OBJECT)/;
+ }
print $_;
}
&Exit unless defined $_;