Remove warning with C++.
It'll will increase the size of the type a little bit. TODO: Check compatibility between code using C def and code using C++ def
This commit is contained in:
1 parent
f2b2335080
commit
d269c23948
1 file changed
+9
-1
@@ -46,6 +46,14 @@
|
|||||||
|
|
||||||
#define DEQUEUI_DEFAULT_SIZE 8
|
#define DEQUEUI_DEFAULT_SIZE 8
|
||||||
|
|
||||||
|
/* C++ doesn't support flexible array within a structure.
|
||||||
|
Let's define at least one element. */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
# define DEQUEI_MIN_ARRAY_SIZE 1
|
||||||
|
#else
|
||||||
|
# define DEQUEI_MIN_ARRAY_SIZE
|
||||||
|
#endif
|
||||||
|
|
||||||
#define DEQUEI_CONTRACT(d) do { \
|
#define DEQUEI_CONTRACT(d) do { \
|
||||||
assert ((d) != NULL); \
|
assert ((d) != NULL); \
|
||||||
assert ((d)->default_size >= DEQUEUI_DEFAULT_SIZE); \
|
assert ((d)->default_size >= DEQUEUI_DEFAULT_SIZE); \
|
||||||
@@ -66,7 +74,7 @@
|
|||||||
typedef struct M_C(name, _node_s) { \
|
typedef struct M_C(name, _node_s) { \
|
||||||
ILIST_INTERFACE(M_C(name, _node_list), struct M_C(name, _node_s)); \
|
ILIST_INTERFACE(M_C(name, _node_list), struct M_C(name, _node_s)); \
|
||||||
size_t size; \
|
size_t size; \
|
||||||
type data[]; \
|
type data[DEQUEI_MIN_ARRAY_SIZE]; \
|
||||||
} node_t; \
|
} node_t; \
|
||||||
\
|
\
|
||||||
ILIST_DEF(M_C(name, _node_list), node_t, (DEL(M_GET_FREE oplist)) ) \
|
ILIST_DEF(M_C(name, _node_list), node_t, (DEL(M_GET_FREE oplist)) ) \
|
||||||
|
|||||||
Reference in new issue
Block a user