summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2018-02-19 08:40:07 +0800
committerJohn Hodge <tpg@ucc.asn.au>2018-02-19 08:40:07 +0800
commit277c6721480be163d8e7e4944acfe9c7c1d5278f (patch)
tree0055776385e6100b6cdff1cf49877d32e752f448 /src
parent99ae4eb88c2861c74a8a3ab6da53b505024cf2c6 (diff)
downloadmrust-277c6721480be163d8e7e4944acfe9c7c1d5278f.tar.gz
Codegen C - Fix bad attempt at making MSVC work
Diffstat (limited to 'src')
-rw-r--r--src/trans/codegen_c.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/trans/codegen_c.cpp b/src/trans/codegen_c.cpp
index 53448ad9..b8770c30 100644
--- a/src/trans/codegen_c.cpp
+++ b/src/trans/codegen_c.cpp
@@ -896,9 +896,9 @@ namespace {
has_unsized = true;
}
else {
- size_t s;
- Target_GetSizeOf(sp, m_resolve, ty, s);
- if( s == 0 ) {
+ size_t s, a;
+ Target_GetSizeAndAlignOf(sp, m_resolve, ty, s, a);
+ if( s == 0 && m_options.disallow_empty_structs ) {
m_of << "// ZST\n";
continue ;
}
@@ -910,12 +910,9 @@ namespace {
}
m_of << ";\n";
}
- if( sized_fields == 0 )
+ if( sized_fields == 0 && m_options.disallow_empty_structs )
{
- if( m_options.disallow_empty_structs )
- {
- m_of << "\tchar _d;\n";
- }
+ m_of << "\tchar _d;\n";
}
m_of << "}";
if(is_packed)