diff --git a/src/ds/defines.h b/src/ds/defines.h index a240739..ca2289e 100644 --- a/src/ds/defines.h +++ b/src/ds/defines.h @@ -28,6 +28,12 @@ # define SNMALLOC_CONSTINIT_STATIC constexpr #endif +#if defined(__cpp_consteval) +# define SNMALLOC_CONSTEVAL consteval +#else +# define SNMALLOC_CONSTEVAL constexpr +#endif + #if !defined(__clang__) && defined(__GNUC__) # define GCC_NOT_CLANG #endif diff --git a/src/ds/ptrwrap.h b/src/ds/ptrwrap.h index ee34cb6..8cf1f81 100644 --- a/src/ds/ptrwrap.h +++ b/src/ds/ptrwrap.h @@ -59,7 +59,7 @@ namespace snmalloc * annotation. */ template - constexpr capptr_bounds capptr_export_type() + SNMALLOC_CONSTEVAL capptr_bounds capptr_export_type() { static_assert( (B == CBChunk) || (B == CBAlloc), "capptr_export_type of bad type"); @@ -74,7 +74,7 @@ namespace snmalloc } template - constexpr bool capptr_is_bounds_refinement() + SNMALLOC_CONSTEVAL bool capptr_is_bounds_refinement() { switch (BI) {