summaryrefslogtreecommitdiff
path: root/src/runtime/c/gu/variant.h
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2013-09-17 12:45:00 +0000
committerkr.angelov <kr.angelov@gmail.com>2013-09-17 12:45:00 +0000
commit2a49e4e1d64ef2df0bb2a8a3822f7fa1048e687f (patch)
treea4584c3831aac1a692c8be37c0c6747480874c00 /src/runtime/c/gu/variant.h
parentf5461eb3d4eb2605b546a4ed202c12bcdaa1f4e4 (diff)
a major refactoring in the C runtime. GuList is now removed and replaced with GuSeq. The GuSeq/GuBuf API is simplified
Diffstat (limited to 'src/runtime/c/gu/variant.h')
-rw-r--r--src/runtime/c/gu/variant.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/runtime/c/gu/variant.h b/src/runtime/c/gu/variant.h
index a9bb10a4a..ab1265ff1 100644
--- a/src/runtime/c/gu/variant.h
+++ b/src/runtime/c/gu/variant.h
@@ -148,7 +148,10 @@ struct GuConstructor {
-typedef GuSList(GuConstructor) GuConstructors;
+typedef struct {
+ int len;
+ GuConstructor* elems;
+} GuConstructors;
typedef const struct GuVariantType GuVariantType, GuType_GuVariant;
@@ -159,7 +162,10 @@ struct GuVariantType {
#define GU_TYPE_INIT_GuVariant(k_, t_, ...) { \
.repr_base = GU_TYPE_INIT_repr(k_, GuVariant, _), \
- .ctors = GU_SLIST(GuConstructor, __VA_ARGS__) \
+ .ctors = { \
+ .len = GU_ARRAY_LEN(GuConstructor,GU_ID({__VA_ARGS__})), \
+ .elems = ((GuConstructor[]){__VA_ARGS__}) \
+ } \
}
extern GU_DECLARE_KIND(GuVariant);