Author: dagolden
Date: Thu Jul 23 20:09:41 2009
New Revision: 13112

Modified:
   ExtUtils-ParseXS/trunk/Changes
   ExtUtils-ParseXS/trunk/lib/ExtUtils/ParseXS.pm

Log:
Fixed "const char *" errors for 5.8.8 (and older) (RT#48104)


Modified: ExtUtils-ParseXS/trunk/Changes
==============================================================================
--- ExtUtils-ParseXS/trunk/Changes      (original)
+++ ExtUtils-ParseXS/trunk/Changes      Thu Jul 23 20:09:41 2009
@@ -3,6 +3,8 @@
 2.20_03 - 
 
  Bug fixes:
+ - Fixed "const char *" errors for 5.8.8 (and older) (RT#48104) 
+   [Vincent Pit] 
  - Added newline before a preprocessor directive (RT#30673)
    [patch by hjp]
 

Modified: ExtUtils-ParseXS/trunk/lib/ExtUtils/ParseXS.pm
==============================================================================
--- ExtUtils-ParseXS/trunk/lib/ExtUtils/ParseXS.pm      (original)
+++ ExtUtils-ParseXS/trunk/lib/ExtUtils/ParseXS.pm      Thu Jul 23 20:09:41 2009
@@ -976,10 +976,15 @@
 ##endif
 EOF
 
+  #Under 5.8.x and lower, newXS is declared in proto.h as expecting a non-const
+  #file name argument. If the wrong qualifier is used, it causes breakage with
+  #C++ compilers and warnings with recent gcc.
+  my $file_decl = ($] < 5.009) ? "char file[]" : "const char* file";
+
   #-Wall: if there is no $Full_func_name there are no xsubs in this .xs
   #so `file' is unused
   print Q(<<"EOF") if $Full_func_name;
-#    const char* file = __FILE__;
+#    $file_decl = __FILE__;
 EOF
 
   print Q("#\n");

Reply via email to