From d560183973225e47cb28339379151f8979ac1098 Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Wed, 24 Jul 2024 17:20:06 +0900 Subject: [PATCH] hijack more! --- .../rostests/apitests/shell32/LocaleTests.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/modules/rostests/apitests/shell32/LocaleTests.cpp b/modules/rostests/apitests/shell32/LocaleTests.cpp index f98b8940570ff..0c62da178d9f6 100644 --- a/modules/rostests/apitests/shell32/LocaleTests.cpp +++ b/modules/rostests/apitests/shell32/LocaleTests.cpp @@ -62,15 +62,24 @@ std::set langs; std::map mod; std::map parts; -static void InitParts(void) +struct PART_PAIR { + E_STRING eString; PART_TEST part_test; -#define DEFINE_PART(eString, eModule, id, nParts) do { \ - part_test = { eModule, id, nParts }; \ - parts.insert(std::make_pair(eString, part_test)); \ - } while (0); +}; + +static void InitParts(void) +{ + static const PART_PAIR s_pairs[] = + { +#define DEFINE_PART(eString, eModule, id, nParts) { eString, { eModule, id, nParts } }, #include "parts.h" #undef DEFINE_PART + }; + for (auto& pair : s_pairs) + { + parts.insert(std::make_pair(pair.eString, pair.part_test)); + } } static PART_MATCH PartMatches[] =