summaryrefslogtreecommitdiff
blob: e60e030d9e231dd41e3914c8dc58b5afd51d4974 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--- lib/ExtUtils/ParseXS.pm	2009-07-18 23:23:17.000000000 +0200
+++ lib/ExtUtils/ParseXS.pm	2009-07-23 16:42:34.000000000 +0200
@@ -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");