aboutsummaryrefslogtreecommitdiff
path: root/src/types.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-10-08 10:58:16 +0100
committerGinger Bill <bill@gingerbill.org>2017-10-08 10:58:16 +0100
commit56a98a483f34cf5a76d583a6b55a586ceb83084b (patch)
treef44f603f68339cef29013c6bdfb4072918e89f62 /src/types.cpp
parentdf7a4eda8aaeb134e10a507b21c31637c84781e1 (diff)
Better error messages for import cycles
Diffstat (limited to 'src/types.cpp')
-rw-r--r--src/types.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/types.cpp b/src/types.cpp
index dac5ff8de..85af08a9b 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -1120,6 +1120,24 @@ bool are_types_identical(Type *x, Type *y) {
}
break;
+ case Type_BitField:
+ if (y->kind == Type_BitField) {
+ if (x->BitField.field_count == y->BitField.field_count &&
+ x->BitField.custom_align == y->BitField.custom_align) {
+ for (i32 i = 0; i < x->BitField.field_count; i++) {
+ if (x->BitField.offsets[i] != y->BitField.offsets[i]) {
+ return false;
+ }
+ if (x->BitField.sizes[i] != y->BitField.sizes[i]) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ }
+ break;
+
case Type_Enum:
return x == y; // NOTE(bill): All enums are unique