diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-06-06 17:43:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-06 17:43:06 +0200 |
commit | 3f0ce75738e487612d777efb86fedcd566598f50 (patch) | |
tree | c920e87a8c4328b989d5a6b3b2472072f4bca7af | |
parent | 7272ccb53e491c4c851cd0247ea6e3946dafcba7 (diff) | |
parent | 357af68e03b9aebf8f693a588ed35ab8d027df2d (diff) |
Merge pull request #61732 from aaronfranke/arch-os-feature
-rw-r--r-- | core/os/os.cpp | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/core/os/os.cpp b/core/os/os.cpp index 4f7095b0fc..327f1c95f2 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -413,19 +413,29 @@ bool OS::has_feature(const String &p_feature) { if (sizeof(void *) == 4 && p_feature == "32") { return true; } -#if defined(__x86_64) || defined(__x86_64__) || defined(__amd64__) +#if defined(__x86_64) || defined(__x86_64__) || defined(__amd64__) || defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(_M_X64) +#if defined(__x86_64) || defined(__x86_64__) || defined(__amd64__) || defined(_M_X64) if (p_feature == "x86_64") { return true; } -#elif (defined(__i386) || defined(__i386__)) +#elif defined(__i386) || defined(__i386__) || defined(_M_IX86) + if (p_feature == "x86_32") { + return true; + } +#endif if (p_feature == "x86") { return true; } -#elif defined(__aarch64__) +#elif defined(__arm__) || defined(__aarch64__) || defined(_M_ARM) || defined(_M_ARM64) +#if defined(__aarch64__) || defined(_M_ARM64) if (p_feature == "arm64") { return true; } -#elif defined(__arm__) +#elif defined(__arm__) || defined(_M_ARM) + if (p_feature == "arm32") { + return true; + } +#endif #if defined(__ARM_ARCH_7A__) if (p_feature == "armv7a" || p_feature == "armv7") { return true; @@ -457,6 +467,19 @@ bool OS::has_feature(const String &p_feature) { if (p_feature == "ppc") { return true; } +#elif defined(__wasm__) +#if defined(__wasm64__) + if (p_feature == "wasm64") { + return true; + } +#elif defined(__wasm32__) + if (p_feature == "wasm32") { + return true; + } +#endif + if (p_feature == "wasm") { + return true; + } #endif if (_check_internal_feature_support(p_feature)) { |