summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcflags.SH2
-rw-r--r--cpan/Time-HiRes/Makefile.PL3
-rw-r--r--perl.h17
3 files changed, 18 insertions, 4 deletions
diff --git a/cflags.SH b/cflags.SH
index 899c465cac..5363f992a5 100755
--- a/cflags.SH
+++ b/cflags.SH
@@ -142,7 +142,7 @@ Intel*) ;; # # Is that you, Intel C++?
case " $ccflags " in
*" $opt "*) ;; # Skip if already there.
*) rm -f _cflags$_exe
- case "`$cc $cflags $warn $stdflags $opt _cflags.c -o _cflags$_exe 2>&1`" in
+ case "`$cc -DPERL_NO_INLINE_FUNCTIONS $cflags $warn $stdflags $opt _cflags.c -o _cflags$_exe 2>&1`" in
*"unrecognized"*) ;;
*"implicit declaration"*) ;; # Was something useful hidden?
*"Invalid"*) ;;
diff --git a/cpan/Time-HiRes/Makefile.PL b/cpan/Time-HiRes/Makefile.PL
index 6f6a790077..f27439e800 100644
--- a/cpan/Time-HiRes/Makefile.PL
+++ b/cpan/Time-HiRes/Makefile.PL
@@ -115,7 +115,8 @@ __EOD__
}
}
- my $ccflags = $Config{'ccflags'} . ' ' . "-I$COREincdir";
+ my $ccflags = $Config{'ccflags'} . ' ' . "-I$COREincdir"
+ . ' -DPERL_NO_INLINE_FUNCTIONS';
if ($^O eq 'VMS') {
$cccmd = "$Config{'cc'} /include=($COREincdir) $tmp.c";
diff --git a/perl.h b/perl.h
index 5639f1cb74..89f4c98904 100644
--- a/perl.h
+++ b/perl.h
@@ -5239,8 +5239,21 @@ EXTCONST bool PL_valid_types_NV_set[];
#endif
-/* Static inline funcs that depend on includes and declarations above */
-#include "inline.h"
+#ifndef PERL_NO_INLINE_FUNCTIONS
+/* Static inline funcs that depend on includes and declarations above.
+ Some of these reference functions in the perl object files, and some
+ compilers aren't smart enough to eliminate unused static inline
+ functions, so including this file in source code can cause link errors
+ even if the source code uses none of the functions. Hence including these
+ can be be suppressed by setting PERL_NO_INLINE_FUNCTIONS. Doing this will
+ (obviously) result in unworkable XS code, but allows simple probing code
+ to continue to work, because it permits tests to include the perl headers
+ for definitions without creating a link dependency on the perl library
+ (which may not exist yet).
+*/
+
+# include "inline.h"
+#endif
#include "overload.h"