Skip to content

Commit

Permalink
Add Architecture files..
Browse files Browse the repository at this point in the history
  • Loading branch information
modmuss50 committed Dec 29, 2023
1 parent 47fd38c commit f4a8b12
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Architecture.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include "Architecture.h"

std::wstring Architecture::AsString(const Value& arch)
{
switch (arch) {
case X64:
return L"x64";
case ARM64:
return L"arm64";
case X86:
return L"x86";
case UNKNOWN:
default:
return L"unknown";
}
}
21 changes: 21 additions & 0 deletions src/Architecture.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#pragma once

#include <string>

namespace Architecture
{
// Ordered to ensure that we only check for JVMs that will run on the host arch.
// On an x64 host only check for x64 and x86 as arm will never run.
// On x86 there is no need to try any other arch as it wont run.
enum Value {
UNKNOWN,
ARM64,
X64,
X86,
};

constexpr Value VALUES[] = { UNKNOWN, ARM64, X64, X86 };

std::wstring AsString(const Value& arch);
};

0 comments on commit f4a8b12

Please sign in to comment.