Add UnsignedChar API + implement for gcc

This commit is contained in:
Thomas Desveaux 2018-04-09 16:57:11 +02:00
parent 2ac3153f81
commit ba8835fb54
3 changed files with 30 additions and 0 deletions

View File

@ -1336,6 +1336,12 @@
}
}
api.register {
name = "unsignedchar",
scope = "config",
kind = "boolean",
}
-----------------------------------------------------------------------------
--
-- Field name aliases for backward compatibility

View File

@ -96,6 +96,10 @@
},
symbols = {
On = "-g"
},
unsignedchar = {
On = "-funsigned-char",
Off = "-fno-unsigned-char"
}
}

View File

@ -788,3 +788,23 @@
test.contains({ "-std=gnu++17" }, gcc.getcxxflags(cfg))
test.contains({ }, gcc.getcflags(cfg))
end
--
-- Test unsigned-char flags.
--
function suite.sharedflags_onUnsignedChar()
unsignedchar "On"
prepare()
test.contains({ "-funsigned-char" }, gcc.getcxxflags(cfg))
test.contains({ "-funsigned-char" }, gcc.getcflags(cfg))
end
function suite.sharedflags_onNoUnsignedChar()
unsignedchar "Off"
prepare()
test.contains({ "-fno-unsigned-char" }, gcc.getcxxflags(cfg))
test.contains({ "-fno-unsigned-char" }, gcc.getcflags(cfg))
end