Add structmemberalign API + implement for vstudio

This commit is contained in:
Thomas Desveaux 2018-04-09 17:23:10 +02:00
parent 2ac3153f81
commit b981e67e89
3 changed files with 36 additions and 0 deletions

View File

@ -1238,3 +1238,20 @@
</ClCompile>
]]
end
--
-- Check StructMemberAlignment
--
function suite.structMemberAlignment()
structmemberalign "1Byte"
prepare()
test.capture [[
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<StructMemberAlignment>1Byte</StructMemberAlignment>
</ClCompile>
]]
end

View File

@ -347,6 +347,7 @@
m.compileAs,
m.callingConvention,
m.languageStandard,
m.structMemberAlignment,
}
if cfg.kind == p.STATICLIB then
@ -1269,6 +1270,11 @@
end
end
function m.structMemberAlignment(cfg)
if cfg.structmemberalign then
m.element("StructMemberAlignment", nil, cfg.structmemberalign)
end
end
function m.additionalCompileOptions(cfg, condition)
local opts = cfg.buildoptions

View File

@ -1336,6 +1336,19 @@
}
}
p.api.register {
name = "structmemberalign",
scope = "config",
kind = "string",
allowed = {
"1Byte",
"2Bytes",
"4Bytes",
"8Bytes",
"16Bytes",
}
}
-----------------------------------------------------------------------------
--
-- Field name aliases for backward compatibility