From ca8ff83914738aebaefdba049d12c4a5d2574a55 Mon Sep 17 00:00:00 2001 From: Julien Lebosquain Date: Thu, 17 Aug 2023 15:28:26 +0200 Subject: [PATCH] Use explicit std::hash for AvnKey/AvnPhysicalKey Should hopefully satisfy the older compiler on the CI server --- native/Avalonia.Native/src/OSX/KeyTransform.mm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/native/Avalonia.Native/src/OSX/KeyTransform.mm b/native/Avalonia.Native/src/OSX/KeyTransform.mm index c9ec857a9a8..ba3d809dd91 100644 --- a/native/Avalonia.Native/src/OSX/KeyTransform.mm +++ b/native/Avalonia.Native/src/OSX/KeyTransform.mm @@ -198,7 +198,7 @@ //{ , AvnPhysicalKeyUndo, 0 } }; -std::unordered_map virtualKeyFromChar = +std::unordered_map virtualKeyFromChar = { // Alphabetic keys { 'A', AvnKeyA }, @@ -339,9 +339,9 @@ static PhysicalKeyArray BuildPhysicalKeyFromScanCode() PhysicalKeyArray physicalKeyFromScanCode = BuildPhysicalKeyFromScanCode(); -static std::unordered_map BuildQwertyVirtualKeyFromPhysicalKey() +static std::unordered_map> BuildQwertyVirtualKeyFromPhysicalKey() { - std::unordered_map result; + std::unordered_map> result; result.reserve(sizeof(keyInfos) / sizeof(keyInfos[0])); for (auto& keyInfo : keyInfos) @@ -352,11 +352,11 @@ static PhysicalKeyArray BuildPhysicalKeyFromScanCode() return result; } -std::unordered_map qwertyVirtualKeyFromPhysicalKey = BuildQwertyVirtualKeyFromPhysicalKey(); +std::unordered_map> qwertyVirtualKeyFromPhysicalKey = BuildQwertyVirtualKeyFromPhysicalKey(); -static std::unordered_map BuildMenuCharFromVirtualKey() +static std::unordered_map> BuildMenuCharFromVirtualKey() { - std::unordered_map result; + std::unordered_map> result; result.reserve(100); for (auto& keyInfo : keyInfos) @@ -368,7 +368,7 @@ static PhysicalKeyArray BuildPhysicalKeyFromScanCode() return result; } -std::unordered_map menuCharFromVirtualKey = BuildMenuCharFromVirtualKey(); +std::unordered_map> menuCharFromVirtualKey = BuildMenuCharFromVirtualKey(); static bool IsNumpadOrNumericKey(AvnPhysicalKey physicalKey) {