summaryrefslogtreecommitdiff
path: root/libmisc/include
diff options
context:
space:
mode:
Diffstat (limited to 'libmisc/include')
-rw-r--r--libmisc/include/libmisc/macro.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/libmisc/include/libmisc/macro.h b/libmisc/include/libmisc/macro.h
index f155f7d..8793d1e 100644
--- a/libmisc/include/libmisc/macro.h
+++ b/libmisc/include/libmisc/macro.h
@@ -122,7 +122,9 @@
#define _LM_EVAL__2(...) _LM_EVAL__1(_LM_EVAL__1(__VA_ARGS__))
#define _LM_EVAL__1(...) __VA_ARGS__
+#define _LM_DEFER1(macro) macro LM_EAT()
#define _LM_DEFER2(macro) macro LM_EAT LM_EAT()()
+#define _LM_DEFER3(macro) macro LM_EAT LM_EAT LM_EAT()()()
/**
* LM_FOREACH_PARAM(func, (fixedparams), params...) calls
@@ -135,7 +137,7 @@
*/
#define LM_FOREACH_PARAM LM_CAT2_(_LM_FOREACH_PARAM, _LM_EVAL__16())
#define _LM_FOREACH_PARAM(...) _LM_EVAL__16(_LM_FOREACH_PARAM_impl(__VA_ARGS__))
-#define _LM_FOREACH_PARAM_LM_EVAL__16() _LM_DEFER2(_LM_FOREACH_PARAM_indirect)()
+#define _LM_FOREACH_PARAM_LM_EVAL__16() _LM_DEFER1(_LM_FOREACH_PARAM_impl)
#define _LM_FOREACH_PARAM_impl(func, fixedparams, ...) _LM_FOREACH_PARAM_ITEM(func, fixedparams, __VA_ARGS__, ())
#define _LM_FOREACH_PARAM_indirect() _LM_FOREACH_PARAM_impl
@@ -163,7 +165,7 @@
*/
#define LM_FOREACH_TUPLE LM_CAT2_(_LM_FOREACH_TUPLE, _LM_EVAL__16())
#define _LM_FOREACH_TUPLE(...) _LM_EVAL__16(_LM_FOREACH_TUPLE_impl(__VA_ARGS__))
-#define _LM_FOREACH_TUPLE_LM_EVAL__16() _LM_DEFER2(_LM_FOREACH_TUPLE_indirect)()
+#define _LM_FOREACH_TUPLE_LM_EVAL__16() _LM_DEFER1(_LM_FOREACH_TUPLE_impl)
#define _LM_FOREACH_TUPLE_impl(tuples, func, ...) \
LM_IF(LM_TUPLES_IS_NONEMPTY(tuples))( \