From b0c682edd638e668414d498a6b9a96d7edbfa617 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 8 Feb 2024 15:26:20 +0100 Subject: [PATCH] Fix to compile for Windows Signed-off-by: Simon Rozman --- UnitTests/parser.cpp | 18 +++++++++--------- include/stdex/sys_info.hpp | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/UnitTests/parser.cpp b/UnitTests/parser.cpp index e5db86b49..4423a139f 100644 --- a/UnitTests/parser.cpp +++ b/UnitTests/parser.cpp @@ -7,16 +7,16 @@ using namespace std; using namespace stdex; -using namespace parser; +using namespace stdex::parser; #ifdef _WIN32 using namespace Microsoft::VisualStudio::CppUnitTestFramework; namespace Microsoft { namespace VisualStudio { namespace CppUnitTestFramework { - static wstring ToString(const interval& q) + static std::wstring ToString(const stdex::interval& q) { - return sprintf(L"<%zu, %zu>", nullptr, q.start, q.end); + return stdex::sprintf(L"<%zu, %zu>", nullptr, q.start, q.end); } } } @@ -202,7 +202,7 @@ namespace UnitTests Assert::IsTrue(p.match(L"si56 0231 2001 5226 972", 0, SIZE_MAX, match_case_insensitive)); Assert::IsTrue(p.is_valid); Assert::IsTrue(p.match(L"SI56 0231 2001 5226 9720", 0, SIZE_MAX)); - Assert::AreEqual(interval(0, 23), p.interval); + Assert::AreEqual(stdex::interval(0, 23), p.interval); Assert::IsTrue(p.is_valid); Assert::IsTrue(p.match(L"...SI56 0231 2001 5226 972...", 3, SIZE_MAX)); Assert::IsTrue(p.is_valid); @@ -276,11 +276,11 @@ namespace UnitTests Assert::IsTrue(p.match(L"SI121234567890120", 0, SIZE_MAX)); Assert::IsTrue(p.is_valid); Assert::AreEqual(L"12", p.model); - Assert::AreEqual(interval(4, 17), p.part1.interval); + Assert::AreEqual(stdex::interval(4, 17), p.part1.interval); Assert::IsTrue(p.match(L"SI12 1234567890120", 0, SIZE_MAX)); Assert::IsTrue(p.is_valid); Assert::AreEqual(L"12", p.model); - Assert::AreEqual(interval(5, 18), p.part1.interval); + Assert::AreEqual(stdex::interval(5, 18), p.part1.interval); Assert::IsFalse(p.match(L"si12 1234567890120", 0, SIZE_MAX)); Assert::IsTrue(p.match(L"si12 1234567890120", 0, SIZE_MAX, match_case_insensitive)); Assert::IsTrue(p.match(L"...SI12 1234567890120...", 3, SIZE_MAX)); @@ -354,7 +354,7 @@ namespace UnitTests Assert::IsTrue(p.match("si56 0231 2001 5226 972", 0, SIZE_MAX, match_case_insensitive)); Assert::IsTrue(p.is_valid); Assert::IsTrue(p.match("SI56 0231 2001 5226 9720", 0, SIZE_MAX)); - Assert::AreEqual(interval(0, 23), p.interval); + Assert::AreEqual(stdex::interval(0, 23), p.interval); Assert::IsTrue(p.is_valid); Assert::IsTrue(p.match("...SI56 0231 2001 5226 972...", 3, SIZE_MAX)); Assert::IsTrue(p.is_valid); @@ -391,11 +391,11 @@ namespace UnitTests Assert::IsTrue(p.match("SI121234567890120", 0, SIZE_MAX)); Assert::IsTrue(p.is_valid); Assert::AreEqual("12", p.model); - Assert::AreEqual(interval(4, 17), p.part1.interval); + Assert::AreEqual(stdex::interval(4, 17), p.part1.interval); Assert::IsTrue(p.match("SI12 1234567890120", 0, SIZE_MAX)); Assert::IsTrue(p.is_valid); Assert::AreEqual("12", p.model); - Assert::AreEqual(interval(5, 18), p.part1.interval); + Assert::AreEqual(stdex::interval(5, 18), p.part1.interval); Assert::IsFalse(p.match("si12 1234567890120", 0, SIZE_MAX)); Assert::IsTrue(p.match("si12 1234567890120", 0, SIZE_MAX, match_case_insensitive)); Assert::IsTrue(p.match("...SI12 1234567890120...", 3, SIZE_MAX)); diff --git a/include/stdex/sys_info.hpp b/include/stdex/sys_info.hpp index ffed59835..5e29d04c0 100644 --- a/include/stdex/sys_info.hpp +++ b/include/stdex/sys_info.hpp @@ -130,7 +130,7 @@ namespace stdex #ifndef _WIN64 BOOL Wow64Process; #endif - if (IsWow64Process2 && IsWow64Process2(process, &process_machine, &os_platform)) { + if (IsWow64Process2 && IsWow64Process2(process, &process_machine, reinterpret_cast(&os_platform))) { wow64 = process_machine != IMAGE_FILE_MACHINE_UNKNOWN; } #ifdef _WIN64