summaryrefslogtreecommitdiffhomepage
path: root/compat/macros1.h
diff options
context:
space:
mode:
Diffstat (limited to 'compat/macros1.h')
-rw-r--r--compat/macros1.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/compat/macros1.h b/compat/macros1.h
index 5e3129d5..f6b05f0f 100644
--- a/compat/macros1.h
+++ b/compat/macros1.h
@@ -42,6 +42,7 @@
#ifdef __cplusplus
# define progn(...) ([&]() -> decltype(auto) { __VA_ARGS__ }())
+# define eval_once2(expr, ctr) eval_once3(expr, ctr)
+# define eval_once3(expr, ctr) ([&] { [[maybe_unused]] static const char init_ ## ctr = ((void)(expr), 0); }())
# define eval_once(expr) eval_once2(expr, __COUNTER__)
-# define eval_once2(expr, ctr) ([&] { [[maybe_unused]] static auto init ## ctr = (((void)(expr)), 0); }())
#endif