aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-01-29 10:57:09 -0500
committerAndrew Kelley <superjoe30@gmail.com>2018-01-29 10:57:09 -0500
commitabe6c2d5859461900e0ceeb98800987413b3355a (patch)
tree20e6a66ab6211ca62035b9c2a9773059a16b248c /src
parentf66ac9a5e704d9900d9e21cb482d7487a02e7b34 (diff)
downloadzig-abe6c2d5859461900e0ceeb98800987413b3355a.tar.gz
zig-abe6c2d5859461900e0ceeb98800987413b3355a.zip
allow packed containers in extern functions
Diffstat (limited to 'src')
-rw-r--r--src/analyze.cpp6
1 files changed, 3 insertions, 3 deletions
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();
}