Add structmemberalign API + implement for vstudio
This commit is contained in:
parent
2ac3153f81
commit
b981e67e89
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user