From abe6c2d5859461900e0ceeb98800987413b3355a Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 29 Jan 2018 10:57:09 -0500 Subject: allow packed containers in extern functions --- src/analyze.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/analyze.cpp') diff --git a/src/analyze.cpp b/src/analyze.cpp index b3684021aa..9afd4cedc8 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -1242,16 +1242,16 @@ static bool type_allowed_in_extern(CodeGen *g, TypeTableEntry *type_entry) { case TypeTableEntryIdPointer: return type_allowed_in_extern(g, type_entry->data.pointer.child_type); case TypeTableEntryIdStruct: - return type_entry->data.structure.layout == ContainerLayoutExtern; + return type_entry->data.structure.layout == ContainerLayoutExtern || type_entry->data.structure.layout == ContainerLayoutPacked; case TypeTableEntryIdMaybe: { TypeTableEntry *child_type = type_entry->data.maybe.child_type; return child_type->id == TypeTableEntryIdPointer || child_type->id == TypeTableEntryIdFn; } case TypeTableEntryIdEnum: - return type_entry->data.enumeration.layout == ContainerLayoutExtern; + return type_entry->data.enumeration.layout == ContainerLayoutExtern || type_entry->data.enumeration.layout == ContainerLayoutPacked; case TypeTableEntryIdUnion: - return type_entry->data.unionation.layout == ContainerLayoutExtern; + return type_entry->data.unionation.layout == ContainerLayoutExtern || type_entry->data.unionation.layout == ContainerLayoutPacked; } zig_unreachable(); } -- cgit v1.2.3