This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlapi: Add markup
[perl5.git] / perl.h
diff --git a/perl.h b/perl.h
index 4e252d4..f69da26 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -3817,20 +3817,20 @@ intrinsic function, see its documents for more details.
 
 #ifdef DEBUGGING
 #  define ASSUME(x) assert(x)
-#  ifdef __builtin_unreachable
-#    define HAS_BUILTIN_UNREACHABLE_
+#  if __has_builtin(__builtin_unreachable)
+#    define HAS_BUILTIN_UNREACHABLE
 #  elif (defined(__GNUC__) && (   __GNUC__ > 4                              \
                                || __GNUC__ == 4 && __GNUC_MINOR__ >= 5))
-#    define HAS_BUILTIN_UNREACHABLE_
+#    define HAS_BUILTIN_UNREACHABLE
 #  endif
 #endif
 
-#if defined(__sun)
+#if defined(__sun) || (defined(__hpux) && !defined(__GNUC__))
 #  ifndef ASSUME
 #    define ASSUME(x)      /* ASSUME() generates warnings on Solaris */
 #  endif
 #  define NOT_REACHED
-#elif defined(HAS_BUILTIN_UNREACHABLE_)
+#elif defined(HAS_BUILTIN_UNREACHABLE)
 #  ifndef ASSUME
 #    define ASSUME(x) ((x) ? (void) 0 : __builtin_unreachable())
 #  endif
@@ -3850,6 +3850,7 @@ intrinsic function, see its documents for more details.
 #  endif
 #  define NOT_REACHED ASSUME(!"UNREACHABLE")
 #endif
+#undef HAS_BUILTIN_UNREACHABLE
 
 /* Some unistd.h's give a prototype for pause() even though
    HAS_PAUSE ends up undefined.  This causes the #define