From 4b88bddbcac1f994034eb5d7485fd35663c3d325 Mon Sep 17 00:00:00 2001 From: appujee <124090381+appujee@users.noreply.github.com> Date: Wed, 6 Nov 2024 13:14:10 -0800 Subject: [PATCH] Conditionally remove unreachable for C23+ --- include/jemalloc/internal/util.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/jemalloc/internal/util.h b/include/jemalloc/internal/util.h index b400f231..6646386e 100644 --- a/include/jemalloc/internal/util.h +++ b/include/jemalloc/internal/util.h @@ -39,6 +39,15 @@ # define unlikely(x) !!(x) #endif +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L +#include +#else +#if !defined(JEMALLOC_INTERNAL_UNREACHABLE) +# error JEMALLOC_INTERNAL_UNREACHABLE should have been defined by configure +#endif +#define unreachable() JEMALLOC_INTERNAL_UNREACHABLE() +#endif + /* Set error code. */ UTIL_INLINE void set_errno(int errnum) {