iMake oplist optional for BPTREE_DEF

This commit is contained in:
Patrick Pelissier committed 2018-04-07 11:10:13 +02:00
1 parent 42d9fc3284
commit d2f5698397
2 files changed
+9 -5

No files matched your search

+7 -4
View File
@@ -36,10 +36,10 @@
/* Define a B+tree of a given type, of size N.
USAGE: BPTREE_DEF(name, N, type, [, oplist_of_the_type]) */
#define BPTREE_DEF(name, N, type, oplist) \
BPTREEI_DEF2(name, N, type, oplist, type, oplist, 0, \
M_C(name, _t), M_C(name, _node_t), M_C(name, _pit_t), \
M_C(name, _it_t))
#define BPTREE_DEF(name, N, ...) \
BPTREEI_DEF(M_IF_NARGS_EQ1(__VA_ARGS__) \
((name, N, __VA_ARGS__, M_GLOBAL_OPLIST_OR_DEF(__VA_ARGS__), __VA_ARGS__, M_GLOBAL_OPLIST_OR_DEF(__VA_ARGS__), 0, M_C(name, _t), M_C(name, _node_t), M_C(name, _pit_t), M_C(name, _it_t) ), \
(name, N, __VA_ARGS__, __VA_ARGS__, 0, M_C(name, _t), M_C(name, _node_t), M_C(name, _pit_t), M_C(name, _it_t) )))
//TODO: oplist
@@ -80,6 +80,9 @@
/* Max depth of any B+tree */
#define BPTREEI_MAX_STACK ((int)(CHAR_BIT*sizeof (size_t)))
// Deferred evaluation.
#define BPTREEI_DEF(arg) BPTREEI_DEF2 arg
#define BPTREEI_DEF2(name, N, key_t, key_oplist, value_t, value_oplist, isMap, tree_t, node_t, pit_t, it_t) \
\
M_IF(isMap)( \
+2 -1
View File
@@ -31,7 +31,8 @@ BPTREE_DEF2(btree, 3, int, M_DEFAULT_OPLIST, int, M_DEFAULT_OPLIST)
END_COVERAGE
BPTREE_DEF2(btree_my, 3, my_mpz_t, MYMPZ2_OPLIST, my_mpz_t, MYMPZ2_OPLIST)
BPTREE_DEF(btree_myset, 3, my_mpz_t, MYMPZ2_OPLIST)
BPTREE_DEF(btree_intset, 13, int)
BPTREE_DEF(btree_myset, 15, my_mpz_t, MYMPZ2_OPLIST)
static void test1(void)
{