diff --git a/m-algo.h b/m-algo.h index 0cd6c033..d1078f70 100644 --- a/m-algo.h +++ b/m-algo.h @@ -128,6 +128,9 @@ #define ALGOI_DEF_P4(name, container_t, cont_oplist, type_t, type_oplist, it_t) \ \ + M_CHECK_COMPATIBLE_OPLIST(name, 1, container_t, cont_oplist) \ + M_CHECK_COMPATIBLE_OPLIST(name, 2, type_t, type_oplist) \ + \ ALGOI_CALLBACK_P5(name, container_t, cont_oplist, type_t, type_oplist, it_t) \ M_IF_FUNCOBJ(ALGOI_FUNCOBJ_P5(name, container_t, cont_oplist, type_t, type_oplist, it_t)) \ \ diff --git a/m-array.h b/m-array.h index dd5b6f6b..912505f8 100644 --- a/m-array.h +++ b/m-array.h @@ -162,6 +162,8 @@ const struct M_C(name, _s) *array; /* Reference of the array */ \ } it_t[1]; \ \ + M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \ + \ static inline void \ M_C(name, _init)(array_t v) \ { \ diff --git a/m-bptree.h b/m-bptree.h index 24a19d22..911bee7c 100644 --- a/m-bptree.h +++ b/m-bptree.h @@ -318,6 +318,9 @@ int idx; \ } it_t[1]; \ \ + M_CHECK_COMPATIBLE_OPLIST(name, 1, key_t, key_oplist) \ + M_CHECK_COMPATIBLE_OPLIST(name, 2, value_t, value_oplist) \ + \ /* TODO: Can be optimized to alloc for leaf or for node */ \ static inline node_t M_C(name, _new_node)(void) \ { \ diff --git a/m-buffer.h b/m-buffer.h index 1c6fe8e7..1dc2ce61 100644 --- a/m-buffer.h +++ b/m-buffer.h @@ -137,6 +137,8 @@ typedef enum { typedef union { M_C(name, _srcptr) cptr; M_C(name, _ptr) ptr; } M_C(name, _uptr); \ typedef type M_C(name, _type_t); \ \ + M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \ + \ static inline void \ M_C(name, _init)(buffer_t v, size_t size) \ { \ diff --git a/m-concurrent.h b/m-concurrent.h index 36bdafe8..b8e6a4c5 100644 --- a/m-concurrent.h +++ b/m-concurrent.h @@ -151,6 +151,8 @@ \ typedef type M_C(name, _type_t); \ \ + M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \ + \ /* Define the lock strategy (global & shared lock) */ \ static inline void \ M_C(name, _internal_init)(concurrent_t out) \ diff --git a/m-deque.h b/m-deque.h index ad4f9e04..13fae28d 100644 --- a/m-deque.h +++ b/m-deque.h @@ -139,6 +139,8 @@ \ typedef type M_C(name, _type_t); \ \ + M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \ + \ static inline M_C(name, _node_t)* \ M_C(name, _int_new_node)(deque_t d) \ { \ diff --git a/m-dict.h b/m-dict.h index c2bebaf4..0610e5f7 100644 --- a/m-dict.h +++ b/m-dict.h @@ -250,6 +250,9 @@ typedef key_type M_C(name, _key_type_t); \ typedef value_type M_C(name, _value_type_t); \ \ + M_CHECK_COMPATIBLE_OPLIST(name, 1, key_type, key_oplist) \ + M_CHECK_COMPATIBLE_OPLIST(name, 2, value_type, value_oplist) \ + \ typedef struct M_C(name, _it_s) { \ M_C(name, _array_list_pair_it_t) array_it; \ M_C(name, _list_pair_it_t) list_it; \ @@ -1187,6 +1190,9 @@ typedef enum { size_t index; \ } dict_it_t[1]; \ \ + M_CHECK_COMPATIBLE_OPLIST(name, 1, key_type, key_oplist) \ + M_CHECK_COMPATIBLE_OPLIST(name, 2, value_type, value_oplist) \ + \ static inline void \ M_C(name,_int_limit)(dict_t dict, size_t size) \ { \ diff --git a/m-i-list.h b/m-i-list.h index a54c9e59..9e86f842 100644 --- a/m-i-list.h +++ b/m-i-list.h @@ -161,6 +161,8 @@ typedef struct ilist_head_s { struct ilist_head_s *next; \ } it_t[1]; \ \ + M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \ + \ static inline void M_C(name, _init)(list_t list) \ { \ assert (list != NULL); \ diff --git a/m-list.h b/m-list.h index 2420fec7..4cd7d4cc 100644 --- a/m-list.h +++ b/m-list.h @@ -172,6 +172,8 @@ struct M_C(name, _s) *current; \ } it_t[1]; \ \ + M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \ + \ LISTI_MEMPOOL_DEF(name, type, oplist, list_t, it_t) \ LISTI_DEF_P4(name, type, oplist, list_t, it_t) \ LISTI_ITBASE_DEF(name, type, oplist, list_t, it_t) @@ -871,6 +873,8 @@ struct M_C(name, _s) *current; \ } it_t[1]; \ \ + M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \ + \ LISTI_MEMPOOL_DEF(name, type, oplist, list_t, it_t) \ LISTI_DUAL_PUSH_DEF_P4(name, type, oplist, list_t, it_t) \ LISTI_ITBASE_DEF(name, type, oplist, list_t, it_t) diff --git a/m-prioqueue.h b/m-prioqueue.h index 8b2806ae..cb5726ee 100644 --- a/m-prioqueue.h +++ b/m-prioqueue.h @@ -114,6 +114,8 @@ \ typedef M_C(name, _array_it_t) it_t; \ \ + M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \ + \ static inline void \ M_C(name, _init)(prioqueue_t p) \ { \ diff --git a/m-rbtree.h b/m-rbtree.h index 86c61466..4e21cede 100644 --- a/m-rbtree.h +++ b/m-rbtree.h @@ -204,6 +204,8 @@ typedef enum { M_CALL_DEL(oplist, ptr); \ } ) \ \ + M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \ + \ RBTREEI_DEF_P4(name, type, oplist, tree_t, node_t, it_t) #define RBTREEI_DEF_P4(name, type, oplist, tree_t, node_t, it_t) \ diff --git a/m-shared.h b/m-shared.h index 27bde6a0..fe8fc184 100644 --- a/m-shared.h +++ b/m-shared.h @@ -143,6 +143,8 @@ static inline int sharedi_integer_cref(int *p) { return *p; } struct M_C(name, _s) ptr; \ } M_C(name, combine_t)[1]; \ \ + M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \ + \ static inline void \ M_C(name, _init)(M_C(name, _t) shared) \ { \ diff --git a/m-snapshot.h b/m-snapshot.h index 3131948f..b5574c14 100644 --- a/m-snapshot.h +++ b/m-snapshot.h @@ -152,6 +152,8 @@ \ typedef type M_C(name, _type_t); \ \ + M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \ + \ static inline void M_C(name, _init)(M_C(name, _t) snap) \ { \ assert(snap != NULL); \ @@ -532,6 +534,8 @@ static inline void snapshot_mrsw_int_read_end(snapshot_mrsw_int_t s, unsigned in \ typedef type M_C(name, _type_t); \ \ + M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \ + \ static inline void M_C(name, _init)(M_C(name, _t) snap, size_t nReader) \ { \ assert (snap != NULL); \ @@ -624,6 +628,8 @@ static inline void snapshot_mrsw_int_read_end(snapshot_mrsw_int_t s, unsigned in \ typedef type M_C(name, _type_t); \ \ + M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \ + \ static inline void M_C(name, _init)(M_C(name, _t) snap, size_t nReader, size_t nWriter) \ { \ M_C(name, _mrsw_init)(snap->core, nReader + nWriter -1 ); \