Skip to content

Commit f3725fd

Browse files
committed
fixed #13936 - only use a single platform file for win32
1 parent c3ebb48 commit f3725fd

File tree

4 files changed

+18
-22
lines changed

4 files changed

+18
-22
lines changed

lib/platform.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,26 @@ bool Platform::set(const std::string& platformstr, std::string& errstr, const st
8989
// TODO: deprecate
9090
//std::cout << "Platform 'win32A' is deprecated and will be removed in a future version. Please use 'win32a' instead." << std::endl;
9191
t = Type::Win32A;
92-
platformFile = "win32a";
92+
platformFile = "win32";
9393
}
9494
else if (platformstr == "win32a") {
95+
// TODO: deprecate if we have proper UNICODE support in win32.cfg
9596
t = Type::Win32A;
96-
platformFile = platformstr;
97+
platformFile = "win32";
9798
}
9899
else if (platformstr == "win32W") {
99100
// TODO: deprecate
100101
//std::cout << "Platform 'win32W' is deprecated and will be removed in a future version. Please use 'win32w' instead." << std::endl;
101102
t = Type::Win32W;
102-
platformFile = "win32w";
103+
platformFile = "win32";
103104
}
104105
else if (platformstr == "win32w") {
106+
// TODO: deprecate if we have proper UNICODE support in win32.cfg
105107
t = Type::Win32W;
108+
platformFile = "win32";
109+
}
110+
else if (platformstr == "win32") {
111+
t = Type::Win32A;
106112
platformFile = platformstr;
107113
}
108114
else if (platformstr == "win64") {

platforms/win32w.xml

Lines changed: 0 additions & 19 deletions
This file was deleted.

test/testcmdlineparser.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ class TestCmdlineParser : public TestFixture {
282282
TEST_CASE(stdmulti1);
283283
TEST_CASE(stdmulti2);
284284
TEST_CASE(platformWin64);
285+
TEST_CASE(platformWin32);
285286
TEST_CASE(platformWin32A);
286287
TEST_CASE(platformWin32a);
287288
TEST_CASE(platformWin32W);
@@ -1805,6 +1806,14 @@ class TestCmdlineParser : public TestFixture {
18051806
ASSERT_EQUALS(Platform::Type::Win64, settings->platform.type);
18061807
}
18071808

1809+
void platformWin32() {
1810+
REDIRECT;
1811+
const char * const argv[] = {"cppcheck", "--platform=win32", "file.cpp"};
1812+
ASSERT_EQUALS_ENUM(CmdLineParser::Result::Success, parseFromArgs(argv));
1813+
ASSERT_EQUALS(Platform::Type::Win32A, settings->platform.type);
1814+
ASSERT_EQUALS("", GET_REDIRECT_OUTPUT);
1815+
}
1816+
18081817
void platformWin32A() {
18091818
REDIRECT;
18101819
const char * const argv[] = {"cppcheck", "--platform=win32A", "file.cpp"};

0 commit comments

Comments
 (0)