From 600000390ea344df695163374a5b0b70a84f1dbc Mon Sep 17 00:00:00 2001 From: rymut Date: Tue, 29 Oct 2024 07:43:08 +0100 Subject: [PATCH] Support order compilers in HEDLEY_STATIC_ASSERT Implement static assert like funcionality on older compilers. Implementation do not support message, but compilation will fail. --- hedley.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hedley.h b/hedley.h index 8a713e6..d7c38d5 100644 --- a/hedley.h +++ b/hedley.h @@ -1867,7 +1867,7 @@ HEDLEY_DIAGNOSTIC_POP HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) # define HEDLEY_STATIC_ASSERT(expr, message) HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(static_assert(expr, message)) #else -# define HEDLEY_STATIC_ASSERT(expr, message) +# define HEDLEY_STATIC_ASSERT(expr, message) struct { int static_assertion_failed: sizeof(int) * 8 + !(expr); } #endif #if defined(HEDLEY_NULL)