Skip to content

Commit 428c2d3

Browse files
committed
only use a single platform file for win32
1 parent c787aec commit 428c2d3

File tree

4 files changed

+19
-21
lines changed

4 files changed

+19
-21
lines changed

lib/platform.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,26 @@ bool cppcheck::Platform::set(const std::string& platformstr, std::string& errstr
8787
// TODO: deprecate
8888
//std::cout << "Platform 'win32A' is deprecated and will be removed in a future version. Please use 'win32a' instead." << std::endl;
8989
t = Type::Win32A;
90-
platformFile = "win32a";
90+
platformFile = "win32";
9191
}
9292
else if (platformstr == "win32a") {
93+
// TODO: deprecate if we have proper UNICODE support in win32.cfg
9394
t = Type::Win32A;
94-
platformFile = platformstr;
95+
platformFile = "win32";
9596
}
9697
else if (platformstr == "win32W") {
9798
// TODO: deprecate
9899
//std::cout << "Platform 'win32W' is deprecated and will be removed in a future version. Please use 'win32w' instead." << std::endl;
99100
t = Type::Win32W;
100-
platformFile = "win32w";
101+
platformFile = "win32";
101102
}
102103
else if (platformstr == "win32w") {
104+
// TODO: deprecate if we have proper UNICODE support in win32.cfg
103105
t = Type::Win32W;
106+
platformFile = "win32";
107+
}
108+
else if (platformstr == "win32") {
109+
t = Type::Win32A;
104110
platformFile = platformstr;
105111
}
106112
else if (platformstr == "win64") {

platforms/win32w.xml

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

test/testcmdlineparser.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ class TestCmdlineParser : public TestFixture {
149149
TEST_CASE(stdunknown1);
150150
TEST_CASE(stdunknown2);
151151
TEST_CASE(platformWin64);
152+
TEST_CASE(platformWin32);
152153
TEST_CASE(platformWin32A);
153154
TEST_CASE(platformWin32a);
154155
TEST_CASE(platformWin32W);
@@ -1135,6 +1136,15 @@ class TestCmdlineParser : public TestFixture {
11351136
ASSERT_EQUALS("", GET_REDIRECT_OUTPUT);
11361137
}
11371138

1139+
void platformWin32() {
1140+
REDIRECT;
1141+
const char * const argv[] = {"cppcheck", "--platform=win32", "file.cpp"};
1142+
ASSERT(settings->platform.set(cppcheck::Platform::Type::Unspecified));
1143+
ASSERT(parser->parseFromArgs(3, argv));
1144+
ASSERT_EQUALS(cppcheck::Platform::Type::Win32A, settings->platform.type);
1145+
ASSERT_EQUALS("", GET_REDIRECT_OUTPUT);
1146+
}
1147+
11381148
void platformWin32A() {
11391149
REDIRECT;
11401150
const char * const argv[] = {"cppcheck", "--platform=win32A", "file.cpp"};

0 commit comments

Comments
 (0)