Merge pull request #718 from Blizzard/add-notset-characterset

Adding support for NotSet characterset in VS2010+ (#79)
This commit is contained in:
Tom van Dijck 2017-06-13 14:25:13 -07:00 committed by GitHub
commit 6907f6785c
5 changed files with 24 additions and 1 deletions

View File

@ -145,6 +145,7 @@
kind = "string",
allowed = {
"Default",
"ASCII",
"MBCS",
"Unicode",
}

View File

@ -1168,7 +1168,13 @@
function m.characterSet(cfg)
if not vstudio.isMakefile(cfg) then
m.element("CharacterSet", nil, iif(cfg.characterset == p.MBCS, "MultiByte", "Unicode"))
local charactersets = {
ASCII = "NotSet",
MBCS = "MultiByte",
Unicode = "Unicode",
Default = "Unicode"
}
m.element("CharacterSet", nil, charactersets[cfg.characterset])
end
end

View File

@ -138,6 +138,7 @@
Default = { '/D"_UNICODE"', '/D"UNICODE"' },
MBCS = '/D"_MBCS"',
Unicode = { '/D"_UNICODE"', '/D"UNICODE"' },
ASCII = { },
}
}

View File

@ -46,3 +46,12 @@
<CharacterSet>MultiByte</CharacterSet>
]]
end
function suite.onASCII()
characterset "ASCII"
prepare()
test.capture [[
<CharacterSet>NotSet</CharacterSet>
]]
end

View File

@ -414,6 +414,12 @@
test.contains('/D"_MBCS"', msc.getdefines(cfg.defines, cfg))
end
function suite.cflags_onCharSetASCII()
characterset "ASCII"
prepare()
test.excludes({'/D"_MBCS"', '/D"_UNICODE"'}, msc.getdefines(cfg.defines, cfg))
end
--
-- Check handling of system search paths.