From: Paul Marquess Date: Tue, 6 Feb 1996 14:42:09 +0000 (+0000) Subject: xsubpp 1.933 patch X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7d41bd0a020d860cd068d0e3043c99f83eae73d4;p=p5sagit%2Fp5-mst-13.2.git xsubpp 1.933 patch --- diff --git a/lib/ExtUtils/xsubpp b/lib/ExtUtils/xsubpp index 0d9c816..8d8e6dc 100755 --- a/lib/ExtUtils/xsubpp +++ b/lib/ExtUtils/xsubpp @@ -76,7 +76,7 @@ perl(1), perlxs(1), perlxstut(1), perlapi(1) =cut # Global Constants -$XSUBPP_version = "1.932"; +$XSUBPP_version = "1.933"; require 5.002; sub Q ; @@ -404,11 +404,14 @@ sub VERSIONCHECK_handler () sub PROTOTYPE_handler () { + my $specified ; + death("Error: Only 1 PROTOTYPE definition allowed per xsub") if $proto_in_this_xsub ++ ; for (; !/^$BLOCK_re/o; $_ = shift(@line)) { next unless /\S/; + $specified = 1 ; TrimWhitespace($_) ; if ($_ eq 'DISABLE') { $ProtoThisXSUB = 0 @@ -425,6 +428,9 @@ sub PROTOTYPE_handler () } } + # If no prototype specified, then assume empty prototype "" + $ProtoThisXSUB = 2 unless $specified ; + $ProtoUsed = 1 ; } @@ -934,7 +940,12 @@ EOF # Build the prototype string for the xsub if ($ProtoThisXSUB) { - if ($ProtoThisXSUB != 1) { + if ($ProtoThisXSUB == 2) { + # User has specified empty prototype + $ProtoXSUB{$pname} = '""' + } + elsif ($ProtoThisXSUB != 1) { + # User has specified a prototype $ProtoXSUB{$pname} = '"' . $ProtoThisXSUB . '"' } else {