Update tests & fix variant code.

This commit is contained in:
Patrick Pelissier committed 2017-02-26 00:06:02 +01:00
1 parent 30c08d16e3
commit 794ac73441
2 files changed
+33 -2

No files matched your search

+2 -2
View File
@@ -137,13 +137,13 @@
#define VARIANTI_DEFINE_SETTER(name, ...) \
static inline bool M_C(name, _set_empty)(M_C(name,_t) my) { \
static inline void M_C(name, _set_empty)(M_C(name,_t) my) { \
M_C(name, _clear)(my); \
M_C(name, _init)(my); \
} \
M_MAP2(VARIANTI_DEFINE_SETTER_FUNC, name, __VA_ARGS__)
#define VARIANTI_DEFINE_SETTER_FUNC(name, a) \
static inline bool M_C3(name, _set_, VARIANTI_GET_FIELD a)(M_C(name,_t) my,\
static inline void M_C3(name, _set_, VARIANTI_GET_FIELD a)(M_C(name,_t) my, \
VARIANTI_GET_TYPE a VARIANTI_GET_FIELD a ) { \
if (my->type == M_C(VARIANT_, VARIANTI_GET_FIELD a) ) { \
VARIANTI_GET_SET a (my -> value. VARIANTI_GET_FIELD a, \