Make the patchlevel.h inclusion attempt pre-5.6.0-safe(r)
Jarkko Hietaniemi [Sat, 15 Feb 2003 08:16:26 +0000 (08:16 +0000)]
(problem noticed by Graham with List::Util).

p4raw-id: //depot/perl@18709

ext/Data/Dumper/Dumper.xs
ext/Digest/MD5/MD5.xs
ext/MIME/Base64/Base64.xs
ext/Storable/Storable.xs

index 00b52df..c0ab07c 100644 (file)
@@ -5,7 +5,7 @@
 
 #ifndef PERL_VERSION
 #    include <patchlevel.h>
-#    ifndef PERL_VERSION
+#    if !(defined(PERL_VERSION) || (SUBVERSION > 0 && defined(PATCHLEVEL)))
 #        include <could_not_find_Perl_patchlevel.h>
 #    endif
 #    define PERL_VERSION PATCHLEVEL
index b1f2a04..f70acbb 100644 (file)
@@ -44,10 +44,13 @@ extern "C" {
 }
 #endif
 
-#include <patchlevel.h>
-#ifndef PERL_VERSION
-#    include <could_not_find_Perl_patchlevel.h>
+#ifndef PATCHLEVEL
+#    include <patchlevel.h>
+#    if !(defined(PERL_VERSION) || (SUBVERSION > 0 && defined(PATCHLEVEL)))
+#        include <could_not_find_Perl_patchlevel.h>
+#    endif
 #endif
+
 #if PATCHLEVEL <= 4 && !defined(PL_dowarn)
    #define PL_dowarn dowarn
 #endif
index da2da50..6f855fb 100644 (file)
@@ -35,7 +35,13 @@ extern "C" {
 }
 #endif
 
-#include "patchlevel.h"
+#ifndef PATCHLEVEL
+#    include <patchlevel.h>
+#    if !(defined(PERL_VERSION) || (SUBVERSION > 0 && defined(PATCHLEVEL)))
+#        include <could_not_find_Perl_patchlevel.h>
+#    endif
+#endif
+
 #if PATCHLEVEL <= 4 && !defined(PL_dowarn)
    #define PL_dowarn dowarn
 #endif
index 7cc610e..4073f92 100644 (file)
 
 #include <EXTERN.h>
 #include <perl.h>
-#include <patchlevel.h>                /* Perl's one, needed since 5.6 */
+#include <XSUB.h>
+
 #ifndef PERL_VERSION
-#    include <could_not_find_Perl_patchlevel.h>
+#    include <patchlevel.h>            /* Perl's one, needed since 5.6 */
+#    if !(defined(PERL_VERSION) || (SUBVERSION > 0 && defined(PATCHLEVEL)))
+#        include <could_not_find_Perl_patchlevel.h>
+#    endif
 #endif
-#include <XSUB.h>
 
 #ifndef NETWARE
 #if 0