Merge pull request #1046 from tdesveauxPKFX/struct-member-align
Add structmemberalign API
This commit is contained in:
commit
8eecb5cfa7
@ -1267,3 +1267,20 @@
|
||||
</ClCompile>
|
||||
]]
|
||||
end
|
||||
|
||||
--
|
||||
-- Check StructMemberAlignment
|
||||
--
|
||||
|
||||
function suite.structMemberAlignment()
|
||||
structmemberalign(1)
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<StructMemberAlignment>1Byte</StructMemberAlignment>
|
||||
</ClCompile>
|
||||
]]
|
||||
end
|
||||
|
@ -348,6 +348,7 @@
|
||||
m.compileAs,
|
||||
m.callingConvention,
|
||||
m.languageStandard,
|
||||
m.structMemberAlignment,
|
||||
}
|
||||
|
||||
if cfg.kind == p.STATICLIB then
|
||||
@ -1345,6 +1346,20 @@
|
||||
end
|
||||
end
|
||||
|
||||
function m.structMemberAlignment(cfg)
|
||||
local map = {
|
||||
[1] = "1Byte",
|
||||
[2] = "2Bytes",
|
||||
[4] = "4Bytes",
|
||||
[8] = "8Bytes",
|
||||
[16] = "16Bytes"
|
||||
}
|
||||
|
||||
local value = map[cfg.structmemberalign]
|
||||
if value then
|
||||
m.element("StructMemberAlignment", nil, value)
|
||||
end
|
||||
end
|
||||
|
||||
function m.additionalCompileOptions(cfg, condition)
|
||||
local opts = cfg.buildoptions
|
||||
|
@ -1342,6 +1342,19 @@
|
||||
kind = "boolean",
|
||||
}
|
||||
|
||||
p.api.register {
|
||||
name = "structmemberalign",
|
||||
scope = "config",
|
||||
kind = "integer",
|
||||
allowed = {
|
||||
"1",
|
||||
"2",
|
||||
"4",
|
||||
"8",
|
||||
"16",
|
||||
}
|
||||
}
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
--
|
||||
-- Field name aliases for backward compatibility
|
||||
|
Loading…
Reference in New Issue
Block a user