From fd3a41dadc92e7b69b409af5f747004996465032 Mon Sep 17 00:00:00 2001 From: Jimmi Holst Christensen Date: Wed, 18 Jul 2018 17:00:42 +0200 Subject: Allow pointers to anything in extern/exported declarations (#1258) * type_allowed_in_extern accepts all ptr not size 0 * Generate correct headers for none extern structs/unions/enums --- src/analyze.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/analyze.cpp') diff --git a/src/analyze.cpp b/src/analyze.cpp index 2ace893508..06d611f80d 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -1454,7 +1454,9 @@ static bool type_allowed_in_extern(CodeGen *g, TypeTableEntry *type_entry) { case TypeTableEntryIdFn: return type_entry->data.fn.fn_type_id.cc == CallingConventionC; case TypeTableEntryIdPointer: - return type_allowed_in_extern(g, type_entry->data.pointer.child_type); + if (type_size(g, type_entry) == 0) + return false; + return true; case TypeTableEntryIdStruct: return type_entry->data.structure.layout == ContainerLayoutExtern || type_entry->data.structure.layout == ContainerLayoutPacked; case TypeTableEntryIdOptional: -- cgit v1.2.3