diff options
-rw-r--r-- | main.c | 2 | ||||
-rw-r--r-- | toc.c | 2 | ||||
-rw-r--r-- | types.c | 7 |
3 files changed, 4 insertions, 7 deletions
@@ -18,8 +18,6 @@ /* TODO: -replace is_reference in type_resolve_ with system for checking if type is - circularly dependent in a bad way, with compiler_sizeof foo, _ := bar(); nice syntax for #including something into a namespace run stuff at compile time without assigning it to a constant @@ -35,7 +35,7 @@ /* use toc_alignof only for non-structs. it may be incorrect for pre-C(++)11. */ -#if __STDC_VERSION__ >= 201112 || __cplusplus >= 201103L +#if (__STDC_VERSION__ >= 201112 || __cplusplus >= 201103L) && !defined __TINYC__ #include <stdalign.h> #define toc_alignof alignof @@ -107,7 +107,6 @@ static bool struct_find_offsets(StructDef *s) { } static size_t compiler_alignof(Type *t) { - Value v; assert(t->flags & TYPE_IS_RESOLVED); switch (t->kind) { case TYPE_BUILTIN: @@ -115,11 +114,11 @@ static size_t compiler_alignof(Type *t) { case TYPE_VOID: return 1; case TYPE_FN: - return toc_alignof v.fn; + return toc_alignof(FnExpr *); case TYPE_PTR: - return toc_alignof v.ptr; + return toc_alignof(void *); case TYPE_TUPLE: - return toc_alignof v.tuple; + return toc_alignof(Value *); case TYPE_ARR: return compiler_alignof(t->arr.of); case TYPE_SLICE: |