[3.x] Improve architectures in OS::has_feature and make it work on MSVC
This commit is contained in:
parent
ef8401edf5
commit
0470392930
1 changed files with 23 additions and 4 deletions
|
@ -668,19 +668,25 @@ bool OS::has_feature(const String &p_feature) {
|
||||||
if (sizeof(void *) == 4 && p_feature == "32") {
|
if (sizeof(void *) == 4 && p_feature == "32") {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#if defined(__x86_64) || defined(__x86_64__) || defined(__amd64__)
|
#if defined(__x86_64) || defined(__x86_64__) || defined(__amd64__) || defined(_M_X64)
|
||||||
if (p_feature == "x86_64") {
|
if (p_feature == "x86_64") {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#elif (defined(__i386) || defined(__i386__))
|
#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
|
||||||
|
if (p_feature == "x86_32") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (p_feature == "x86") {
|
if (p_feature == "x86") {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#elif defined(__aarch64__)
|
#elif defined(__aarch64__) || defined(_M_ARM64)
|
||||||
if (p_feature == "arm64") {
|
if (p_feature == "arm64") {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#elif defined(__arm__)
|
#elif defined(__arm__) || defined(_M_ARM)
|
||||||
|
if (p_feature == "arm32") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
#if defined(__ARM_ARCH_7A__)
|
#if defined(__ARM_ARCH_7A__)
|
||||||
if (p_feature == "armv7a" || p_feature == "armv7") {
|
if (p_feature == "armv7a" || p_feature == "armv7") {
|
||||||
return true;
|
return true;
|
||||||
|
@ -712,6 +718,19 @@ bool OS::has_feature(const String &p_feature) {
|
||||||
if (p_feature == "ppc") {
|
if (p_feature == "ppc") {
|
||||||
return true;
|
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
|
#endif
|
||||||
|
|
||||||
if (_check_internal_feature_support(p_feature)) {
|
if (_check_internal_feature_support(p_feature)) {
|
||||||
|
|
Loading…
Reference in a new issue