Skip to content

Commit

Permalink
Use explicit std::hash for AvnKey/AvnPhysicalKey
Browse files Browse the repository at this point in the history
Should hopefully satisfy the older compiler on the CI server
  • Loading branch information
MrJul committed Aug 17, 2023
1 parent f211307 commit ca8ff83
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions native/Avalonia.Native/src/OSX/KeyTransform.mm
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
//{ , AvnPhysicalKeyUndo, 0 }
};

std::unordered_map<uint16_t , AvnKey> virtualKeyFromChar =
std::unordered_map<uint16_t, AvnKey> virtualKeyFromChar =
{
// Alphabetic keys
{ 'A', AvnKeyA },
Expand Down Expand Up @@ -339,9 +339,9 @@ static PhysicalKeyArray BuildPhysicalKeyFromScanCode()

PhysicalKeyArray physicalKeyFromScanCode = BuildPhysicalKeyFromScanCode();

static std::unordered_map<AvnPhysicalKey, AvnKey> BuildQwertyVirtualKeyFromPhysicalKey()
static std::unordered_map<AvnPhysicalKey, AvnKey, std::hash<int>> BuildQwertyVirtualKeyFromPhysicalKey()
{
std::unordered_map<AvnPhysicalKey, AvnKey> result;
std::unordered_map<AvnPhysicalKey, AvnKey, std::hash<int>> result;
result.reserve(sizeof(keyInfos) / sizeof(keyInfos[0]));

for (auto& keyInfo : keyInfos)
Expand All @@ -352,11 +352,11 @@ static PhysicalKeyArray BuildPhysicalKeyFromScanCode()
return result;
}

std::unordered_map<AvnPhysicalKey, AvnKey> qwertyVirtualKeyFromPhysicalKey = BuildQwertyVirtualKeyFromPhysicalKey();
std::unordered_map<AvnPhysicalKey, AvnKey, std::hash<int>> qwertyVirtualKeyFromPhysicalKey = BuildQwertyVirtualKeyFromPhysicalKey();

static std::unordered_map<AvnKey, uint16_t> BuildMenuCharFromVirtualKey()
static std::unordered_map<AvnKey, uint16_t, std::hash<int>> BuildMenuCharFromVirtualKey()
{
std::unordered_map<AvnKey, uint16_t> result;
std::unordered_map<AvnKey, uint16_t, std::hash<int>> result;
result.reserve(100);

for (auto& keyInfo : keyInfos)
Expand All @@ -368,7 +368,7 @@ static PhysicalKeyArray BuildPhysicalKeyFromScanCode()
return result;
}

std::unordered_map<AvnKey, uint16_t> menuCharFromVirtualKey = BuildMenuCharFromVirtualKey();
std::unordered_map<AvnKey, uint16_t, std::hash<int>> menuCharFromVirtualKey = BuildMenuCharFromVirtualKey();

static bool IsNumpadOrNumericKey(AvnPhysicalKey physicalKey)
{
Expand Down

0 comments on commit ca8ff83

Please sign in to comment.