aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2016-10-14 16:49:44 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2016-10-14 16:49:44 -0700
commitaa35c41aa67a7389c0b880658f8f797a3cdd3bdb (patch)
treecfa4e23640c07107c5fda17c1e24bc74911dba33
parentb2585bba5da55a4ed381a1b6f2e02574272bbe3b (diff)
downloadvcpkg-aa35c41aa67a7389c0b880658f8f797a3cdd3bdb.tar.gz
vcpkg-aa35c41aa67a7389c0b880658f8f797a3cdd3bdb.zip
Add MachineType enum
-rw-r--r--toolsrc/MachineType.cpp41
-rw-r--r--toolsrc/include/MachineType.h36
-rw-r--r--toolsrc/vcpkg/vcpkg.vcxproj2
-rw-r--r--toolsrc/vcpkg/vcpkg.vcxproj.filters6
4 files changed, 85 insertions, 0 deletions
diff --git a/toolsrc/MachineType.cpp b/toolsrc/MachineType.cpp
new file mode 100644
index 000000000..0115f3e5e
--- /dev/null
+++ b/toolsrc/MachineType.cpp
@@ -0,0 +1,41 @@
+#include "MachineType.h"
+#include "vcpkg_Checks.h"
+
+namespace vcpkg
+{
+ MachineType getMachineType(const uint16_t value)
+ {
+ MachineType t = static_cast<MachineType>(value);
+ switch (t)
+ {
+ case MachineType::UNKNOWN:
+ case MachineType::AM33:
+ case MachineType::AMD64:
+ case MachineType::ARM:
+ case MachineType::ARM64:
+ case MachineType::ARMNT:
+ case MachineType::EBC:
+ case MachineType::I386:
+ case MachineType::IA64:
+ case MachineType::M32R:
+ case MachineType::MIPS16:
+ case MachineType::MIPSFPU:
+ case MachineType::MIPSFPU16:
+ case MachineType::POWERPC:
+ case MachineType::POWERPCFP:
+ case MachineType::R4000:
+ case MachineType::RISCV32:
+ case MachineType::RISCV64:
+ case MachineType::RISCV128:
+ case MachineType::SH3:
+ case MachineType::SH3DSP:
+ case MachineType::SH4:
+ case MachineType::SH5:
+ case MachineType::THUMB:
+ case MachineType::WCEMIPSV2:
+ return t;
+ default:
+ Checks::exit_with_message("Unknown machine type code 0x%x", value);
+ }
+ }
+}
diff --git a/toolsrc/include/MachineType.h b/toolsrc/include/MachineType.h
new file mode 100644
index 000000000..86efb85c5
--- /dev/null
+++ b/toolsrc/include/MachineType.h
@@ -0,0 +1,36 @@
+#pragma once
+#include <cstdint>
+
+namespace vcpkg
+{
+ enum class MachineType : uint16_t
+ {
+ UNKNOWN = 0x0, // The contents of this field are assumed to be applicable to any machine type
+ AM33=0x1d3,//Matsushita AM33
+ AMD64=0x8664,//x64
+ ARM=0x1c0,//ARM little endian
+ ARM64=0xaa64,//ARM64 little endian
+ ARMNT=0x1c4,//ARM Thumb-2 little endian
+ EBC=0xebc,//EFI byte code
+ I386=0x14c,//Intel 386 or later processors and compatible processors
+ IA64=0x200,//Intel Itanium processor family
+ M32R=0x9041,//Mitsubishi M32R little endian
+ MIPS16=0x266,//MIPS16
+ MIPSFPU=0x366,//MIPS with FPU
+ MIPSFPU16=0x466,//MIPS16 with FPU
+ POWERPC=0x1f0,//Power PC little endian
+ POWERPCFP=0x1f1,//Power PC with floating point support
+ R4000=0x166,//MIPS little endian
+ RISCV32=0x5032,//RISC-V 32-bit address space
+ RISCV64=0x5064,//RISC-V 64-bit address space
+ RISCV128=0x5128,//RISC-V 128-bit address space
+ SH3=0x1a2,//Hitachi SH3
+ SH3DSP=0x1a3,//Hitachi SH3 DSP
+ SH4=0x1a6,//Hitachi SH4
+ SH5=0x1a8,//Hitachi SH5
+ THUMB=0x1c2,//Thumb
+ WCEMIPSV2=0x169,//MIPS little-endian WCE v2
+ };
+
+ MachineType getMachineType(const uint16_t value);
+}
diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj
index 40c6f12cf..6dfdc1bb2 100644
--- a/toolsrc/vcpkg/vcpkg.vcxproj
+++ b/toolsrc/vcpkg/vcpkg.vcxproj
@@ -128,6 +128,7 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
+ <ClCompile Include="..\MachineType.cpp" />
<ClCompile Include="..\src\commands_cache.cpp" />
<ClCompile Include="..\src\commands_create.cpp" />
<ClCompile Include="..\src\commands_edit.cpp" />
@@ -149,6 +150,7 @@
<ClCompile Include="..\src\vcpkg_Input.cpp" />
</ItemGroup>
<ItemGroup>
+ <ClInclude Include="..\include\MachineType.h" />
<ClInclude Include="..\include\vcpkg_cmd_arguments.h" />
<ClInclude Include="..\include\vcpkg_Commands.h" />
<ClInclude Include="..\include\vcpkg_Dependencies.h" />
diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters
index 3b836ab3c..ad8057990 100644
--- a/toolsrc/vcpkg/vcpkg.vcxproj.filters
+++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters
@@ -72,6 +72,9 @@
<ClCompile Include="..\src\vcpkg_Input.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\MachineType.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\post_build_lint.h">
@@ -92,5 +95,8 @@
<ClInclude Include="..\include\vcpkg_Input.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\include\MachineType.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
</Project> \ No newline at end of file