Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Unified Diff: runtime/bin/platform.h

Issue 1896203002: Search for a native extension for the host architecture (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/extensions.cc ('k') | runtime/bin/platform_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/platform.h
diff --git a/runtime/bin/platform.h b/runtime/bin/platform.h
index 79cb7bec61264e839ff3f58ca82f0d6c5d00500b..b4c10a22fa8eeb82a66fa674776aa77e5514c169 100644
--- a/runtime/bin/platform.h
+++ b/runtime/bin/platform.h
@@ -6,6 +6,7 @@
#define BIN_PLATFORM_H_
#include "bin/builtin.h"
+#include "platform/globals.h"
namespace dart {
namespace bin {
@@ -19,10 +20,30 @@ class Platform {
static int NumberOfProcessors();
// Returns a string representing the operating system ("linux",
- // "macos" or "windows"). The returned string should not be
+ // "macos", "windows", or "android"). The returned string should not be
// deallocated by the caller.
static const char* OperatingSystem();
+ // Returns the architecture name of the processor the VM is running on
+ // (ia32, x64, arm, arm64, or mips).
+ static const char* HostArchitecture() {
+#if defined(HOST_ARCH_ARM)
+ return "arm";
+#elif defined(HOST_ARCH_ARM64)
+ return "arm64";
+#elif defined(HOST_ARCH_IA32)
+ return "ia32";
+#elif defined(HOST_ARCH_MIPS)
+ return "mips";
+#elif defined(HOST_ARCH_X64)
+ return "x64";
+#else
+#error Architecture detection failed.
+#endif
+ }
+
+ static const char* LibraryPrefix();
+
// Returns a string representing the operating system's shared library
// extension (e.g. 'so', 'dll', ...). The returned string should not be
// deallocated by the caller.
« no previous file with comments | « runtime/bin/extensions.cc ('k') | runtime/bin/platform_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698