This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Tweak the FEATURE_IS_ENABLED() macro to avoid a bug in the HP-UX compiler.
authorNicholas Clark <nick@ccl4.org>
Wed, 11 Apr 2012 14:47:27 +0000 (16:47 +0200)
committerNicholas Clark <nick@ccl4.org>
Wed, 11 Apr 2012 22:35:06 +0000 (00:35 +0200)
feature.h
regen/feature.pl

index b595cab..dc9696e 100644 (file)
--- a/feature.h
+++ b/feature.h
 #define CURRENT_FEATURE_BUNDLE \
     ((CURRENT_HINTS & HINT_FEATURE_MASK) >> HINT_FEATURE_SHIFT)
 
+/* Avoid using ... && Perl_feature_is_enabled(...) as that triggers a bug in
+   the HP-UX cc on PA-RISC */
 #define FEATURE_IS_ENABLED(name)                                       \
        ((CURRENT_HINTS                                                  \
           & HINT_LOCALIZE_HH)                                            \
-           && Perl_feature_is_enabled(aTHX_ STR_WITH_LEN(name)))
+           ? Perl_feature_is_enabled(aTHX_ STR_WITH_LEN(name)) : FALSE)
 /* The longest string we pass in.  */
 #define MAX_FEATURE_LEN (sizeof("evalbytes")-1)
 
index 2a8d369..222215a 100755 (executable)
@@ -231,10 +231,12 @@ print $h <<'EOH';
 #define CURRENT_FEATURE_BUNDLE \
     ((CURRENT_HINTS & HINT_FEATURE_MASK) >> HINT_FEATURE_SHIFT)
 
+/* Avoid using ... && Perl_feature_is_enabled(...) as that triggers a bug in
+   the HP-UX cc on PA-RISC */
 #define FEATURE_IS_ENABLED(name)                                       \
        ((CURRENT_HINTS                                                  \
           & HINT_LOCALIZE_HH)                                            \
-           && Perl_feature_is_enabled(aTHX_ STR_WITH_LEN(name)))
+           ? Perl_feature_is_enabled(aTHX_ STR_WITH_LEN(name)) : FALSE)
 /* The longest string we pass in.  */
 EOH