Skip to content

Commit 0951661

Browse files
committed
only use a single platform file for win32
1 parent b7b0603 commit 0951661

4 files changed

Lines changed: 19 additions & 21 deletions

File tree

lib/platform.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,26 @@ bool Platform::set(const std::string& platformstr, std::string& errstr, const st
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
@@ -242,6 +242,7 @@ class TestCmdlineParser : public TestFixture {
242242
TEST_CASE(stdmulti1);
243243
TEST_CASE(stdmulti2);
244244
TEST_CASE(platformWin64);
245+
TEST_CASE(platformWin32);
245246
TEST_CASE(platformWin32A);
246247
TEST_CASE(platformWin32a);
247248
TEST_CASE(platformWin32W);
@@ -1528,6 +1529,15 @@ class TestCmdlineParser : public TestFixture {
15281529
ASSERT_EQUALS(Platform::Type::Win64, settings->platform.type);
15291530
}
15301531

1532+
void platformWin32() {
1533+
REDIRECT;
1534+
const char * const argv[] = {"cppcheck", "--platform=win32", "file.cpp"};
1535+
ASSERT(settings->platform.set(cppcheck::Platform::Type::Unspecified));
1536+
ASSERT(parser->parseFromArgs(3, argv));
1537+
ASSERT_EQUALS(cppcheck::Platform::Type::Win32A, settings->platform.type);
1538+
ASSERT_EQUALS("", GET_REDIRECT_OUTPUT);
1539+
}
1540+
15311541
void platformWin32A() {
15321542
REDIRECT;
15331543
const char * const argv[] = {"cppcheck", "--platform=win32A", "file.cpp"};

0 commit comments

Comments
 (0)