Fix preprocessing issue

in case of recursive tuple or variant.
This commit is contained in:
Patrick Pelissier committed 2020-05-30 12:13:43 +02:00
1 parent 79a8401d75
commit 92bddcaab4
2 files changed
+6 -4

No files matched your search

+3 -2
View File
@@ -33,7 +33,7 @@
USAGE:
TUPLE_DEF2(name, [(field1, type1[, oplist1]), (field2, type2[, oplist2]), ...] ) */
#define TUPLE_DEF2(name, ...) \
TUPLEI_DEF2_P1( (name, TUPLEI_INJECT_GLOBAL(__VA_ARGS__)) )
TUPLEI_DEF2_P1( (name TUPLEI_INJECT_GLOBAL(__VA_ARGS__)) )
/* Define the oplist of a tuple.
@@ -80,7 +80,7 @@ namespace m_tuple {
/* Inject the oplist within the list of arguments */
#define TUPLEI_INJECT_GLOBAL(...) \
M_MAP_C(TUPLEI_INJECT_OPLIST_A, __VA_ARGS__)
M_MAP(TUPLEI_INJECT_OPLIST_A, __VA_ARGS__)
/* Transform (x, type) into (x, type, oplist) if there is global registered oplist
or (x, type, M_DEFAULT_OPLIST) if there is no global one,
@@ -89,6 +89,7 @@ namespace m_tuple {
TUPLEI_INJECT_OPLIST_B duo_or_trio
#define TUPLEI_INJECT_OPLIST_B( f, ... ) \
M_DEFERRED_COMMA \
M_IF_NARGS_EQ1(__VA_ARGS__)( (f, __VA_ARGS__, M_GLOBAL_OPLIST_OR_DEF(__VA_ARGS__)()), (f, __VA_ARGS__) )
// Deferred evaluation
+3 -2
View File
@@ -34,7 +34,7 @@
USAGE:
VARIANT_DEF2(name, [(field1, type1, oplist1), (field2, type2, oplist2), ...] ) */
#define VARIANT_DEF2(name, ...) \
VARIANTI_DEF2_P1( (name, VARIANTI_INJECT_GLOBAL(__VA_ARGS__)) )
VARIANTI_DEF2_P1( (name VARIANTI_INJECT_GLOBAL(__VA_ARGS__)) )
/* Define the oplist of a variant.
@@ -56,7 +56,7 @@
/* Inject the oplist within the list of arguments */
#define VARIANTI_INJECT_GLOBAL(...) \
M_MAP_C(VARIANTI_INJECT_OPLIST_A, __VA_ARGS__)
M_MAP(VARIANTI_INJECT_OPLIST_A, __VA_ARGS__)
/* Transform (x, type) into (x, type, oplist) if there is global registered oplist
or (x, type, M_DEFAULT_OPLIST) if there is no global one,
@@ -65,6 +65,7 @@
VARIANTI_INJECT_OPLIST_B duo_or_trio
#define VARIANTI_INJECT_OPLIST_B( f, ... ) \
M_DEFERRED_COMMA \
M_IF_NARGS_EQ1(__VA_ARGS__)( (f, __VA_ARGS__, M_GLOBAL_OPLIST_OR_DEF(__VA_ARGS__)()), (f, __VA_ARGS__) )
// Deferred evaluation