Fix preprocessing issue
in case of recursive tuple or variant.
This commit is contained in:
1 parent
79a8401d75
commit
92bddcaab4
2 files changed
+6
-4
No files matched your search
@@ -33,7 +33,7 @@
|
|||||||
USAGE:
|
USAGE:
|
||||||
TUPLE_DEF2(name, [(field1, type1[, oplist1]), (field2, type2[, oplist2]), ...] ) */
|
TUPLE_DEF2(name, [(field1, type1[, oplist1]), (field2, type2[, oplist2]), ...] ) */
|
||||||
#define TUPLE_DEF2(name, ...) \
|
#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.
|
/* Define the oplist of a tuple.
|
||||||
@@ -80,7 +80,7 @@ namespace m_tuple {
|
|||||||
|
|
||||||
/* Inject the oplist within the list of arguments */
|
/* Inject the oplist within the list of arguments */
|
||||||
#define TUPLEI_INJECT_GLOBAL(...) \
|
#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
|
/* 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,
|
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
|
TUPLEI_INJECT_OPLIST_B duo_or_trio
|
||||||
|
|
||||||
#define TUPLEI_INJECT_OPLIST_B( f, ... ) \
|
#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__) )
|
M_IF_NARGS_EQ1(__VA_ARGS__)( (f, __VA_ARGS__, M_GLOBAL_OPLIST_OR_DEF(__VA_ARGS__)()), (f, __VA_ARGS__) )
|
||||||
|
|
||||||
// Deferred evaluation
|
// Deferred evaluation
|
||||||
|
|||||||
+3
-2
@@ -34,7 +34,7 @@
|
|||||||
USAGE:
|
USAGE:
|
||||||
VARIANT_DEF2(name, [(field1, type1, oplist1), (field2, type2, oplist2), ...] ) */
|
VARIANT_DEF2(name, [(field1, type1, oplist1), (field2, type2, oplist2), ...] ) */
|
||||||
#define VARIANT_DEF2(name, ...) \
|
#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.
|
/* Define the oplist of a variant.
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
/* Inject the oplist within the list of arguments */
|
/* Inject the oplist within the list of arguments */
|
||||||
#define VARIANTI_INJECT_GLOBAL(...) \
|
#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
|
/* 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,
|
or (x, type, M_DEFAULT_OPLIST) if there is no global one,
|
||||||
@@ -65,6 +65,7 @@
|
|||||||
VARIANTI_INJECT_OPLIST_B duo_or_trio
|
VARIANTI_INJECT_OPLIST_B duo_or_trio
|
||||||
|
|
||||||
#define VARIANTI_INJECT_OPLIST_B( f, ... ) \
|
#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__) )
|
M_IF_NARGS_EQ1(__VA_ARGS__)( (f, __VA_ARGS__, M_GLOBAL_OPLIST_OR_DEF(__VA_ARGS__)()), (f, __VA_ARGS__) )
|
||||||
|
|
||||||
// Deferred evaluation
|
// Deferred evaluation
|
||||||
|
|||||||
Reference in new issue
Block a user