This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Simplify generated XS code by emitting a compatibility version of dVAR.
authorNicholas Clark <nick@ccl4.org>
Sat, 10 Sep 2011 11:11:21 +0000 (13:11 +0200)
committerNicholas Clark <nick@ccl4.org>
Sun, 11 Sep 2011 15:14:15 +0000 (17:14 +0200)
If ExtUtils::ParseXS emits conditional C pre-processor code once per XS file
to provide a default for dVAR, then it doesn't need to emit 4 lines per
function to cater for dVAR not being present.

dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Constants.pm
dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/CountLines.pm
dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm
pod/perldelta.pod

index 36b88a5..0440529 100644 (file)
@@ -11,7 +11,7 @@ use Symbol;
 
 our $VERSION;
 BEGIN {
-  $VERSION = '3.04_03';
+  $VERSION = '3.04_04';
 }
 use ExtUtils::ParseXS::Constants $VERSION;
 use ExtUtils::ParseXS::CountLines $VERSION;
@@ -505,11 +505,7 @@ EOM
 #XS_EUPXS(XS_${Full_func_name}); /* prototype to pass -Wmissing-prototypes */
 #XS_EUPXS(XS_${Full_func_name})
 #[[
-##ifdef dVAR
 #    dVAR; dXSARGS;
-##else
-#    dXSARGS;
-##endif
 EOF
     print Q(<<"EOF") if $ALIAS;
 #    dXSI32;
@@ -911,11 +907,7 @@ EOF
 
   print Q(<<"EOF");
 #[[
-##ifdef dVAR
 #    dVAR; dXSARGS;
-##else
-#    dXSARGS;
-##endif
 EOF
 
   #Under 5.8.x and lower, newXS is declared in proto.h as expecting a non-const
index 4e97418..4de9d3c 100644 (file)
@@ -3,7 +3,7 @@ use strict;
 use warnings;
 use Symbol;
 
-our $VERSION = '3.04_03';
+our $VERSION = '3.04_04';
 
 =head1 NAME
 
index 3b166b1..ff8fd2e 100644 (file)
@@ -1,7 +1,7 @@
 package ExtUtils::ParseXS::CountLines;
 use strict;
 
-our $VERSION = '3.04_03';
+our $VERSION = '3.04_04';
 
 our $SECTION_END_MARKER;
 
index 4080458..f3b9d09 100644 (file)
@@ -6,7 +6,7 @@ use File::Spec;
 use lib qw( lib );
 use ExtUtils::ParseXS::Constants ();
 
-our $VERSION = '3.04_03';
+our $VERSION = '3.04_04';
 
 our (@ISA, @EXPORT_OK);
 @ISA = qw(Exporter);
@@ -455,6 +455,10 @@ sub standard_XS_defs {
 #  define PERL_UNUSED_VAR(var) if (0) var = var
 #endif
 
+#ifndef dVAR
+#  define dVAR         dNOOP
+#endif
+
 
 /* This stuff is not part of the API! You have been warned. */
 #ifndef PERL_VERSION_DECIMAL
index 07b3273..301d63d 100644 (file)
@@ -175,6 +175,12 @@ The XS code for sorting hash keys has been simplified slightly.
 
 =item *
 
+L<ExtUtils::ParseXS> has been upgraded from version 3.04_03 to version 3.04_04.
+
+The handling of C<dVAR> in the generated XS code has been simplified.
+
+=item *
+
 L<Locale::Codes> has been upgraded from version 3.17 to version 3.18.
 
 The CIA world added non-standard values, so this is no longer used as a source