diff --git a/modules/vstudio/tests/vc2010/test_compile_settings.lua b/modules/vstudio/tests/vc2010/test_compile_settings.lua index 8c070981..0900c808 100644 --- a/modules/vstudio/tests/vc2010/test_compile_settings.lua +++ b/modules/vstudio/tests/vc2010/test_compile_settings.lua @@ -1244,7 +1244,7 @@ -- function suite.structMemberAlignment() - structmemberalign "1Byte" + structmemberalign(1) prepare() test.capture [[ diff --git a/modules/vstudio/vs2010_vcxproj.lua b/modules/vstudio/vs2010_vcxproj.lua index f0d1a216..8bc46698 100644 --- a/modules/vstudio/vs2010_vcxproj.lua +++ b/modules/vstudio/vs2010_vcxproj.lua @@ -1347,8 +1347,17 @@ end function m.structMemberAlignment(cfg) - if cfg.structmemberalign then - m.element("StructMemberAlignment", nil, cfg.structmemberalign) + 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 diff --git a/src/_premake_init.lua b/src/_premake_init.lua index f20206d5..39f0c6dc 100644 --- a/src/_premake_init.lua +++ b/src/_premake_init.lua @@ -1339,13 +1339,13 @@ p.api.register { name = "structmemberalign", scope = "config", - kind = "string", + kind = "integer", allowed = { - "1Byte", - "2Bytes", - "4Bytes", - "8Bytes", - "16Bytes", + "1", + "2", + "4", + "8", + "16", } }