summaryrefslogtreecommitdiff
path: root/src/trans/target.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2018-09-09 22:19:40 +0800
committerJohn Hodge <tpg@mutabah.net>2018-09-09 22:20:32 +0800
commitd85ac84278fa0322f1df0b16a45a1cdde83cba57 (patch)
tree66bad02a3c0bb9144e629d2ac8294b58430ff4ef /src/trans/target.cpp
parentdd4e3c887fa2eef2db6fa2795d4283636a1cc26e (diff)
downloadmrust-d85ac84278fa0322f1df0b16a45a1cdde83cba57.tar.gz
Msvc compile fixes
Diffstat (limited to 'src/trans/target.cpp')
-rw-r--r--src/trans/target.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/trans/target.cpp b/src/trans/target.cpp
index ea850937..f91b679a 100644
--- a/src/trans/target.cpp
+++ b/src/trans/target.cpp
@@ -691,7 +691,12 @@ bool Target_GetSizeAndAlignOf(const Span& sp, const StaticTraitResolve& resolve,
case ::HIR::CoreType::I128:
out_size = 16;
// TODO: If i128 is emulated, this can be 8 (as it is on x86, where it's actually 4 due to the above comment)
- out_align = g_target.m_arch.m_name == "x86" ? 4 : 16;
+ if( g_target.m_arch.m_name == "x86" )
+ out_align = 4;
+ else if( /*g_target.m_arch.m_name == "x86_64" && */g_target.m_backend_c.m_codegen_mode == CodegenMode::Msvc )
+ out_align = 8;
+ else
+ out_align = 16;
return true;
case ::HIR::CoreType::Usize:
case ::HIR::CoreType::Isize: