Skip to content

Commit

Permalink
Add constants for Windows on ARM.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Jul 17, 2024
1 parent 1a50fd2 commit 5463913
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions base/platform/base_platform_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ enum class OutdateReason {
[[nodiscard]] constexpr bool IsWindows();
[[nodiscard]] constexpr bool IsWindows32Bit();
[[nodiscard]] constexpr bool IsWindows64Bit();
[[nodiscard]] constexpr bool IsWindowsARM64();
[[nodiscard]] constexpr bool IsWindowsStoreBuild();
[[nodiscard]] bool IsWindows7OrGreater();
[[nodiscard]] bool IsWindows8OrGreater();
Expand Down
1 change: 1 addition & 0 deletions base/platform/linux/base_info_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ inline constexpr bool IsLinux() {
inline constexpr bool IsWindows() { return false; }
inline constexpr bool IsWindows32Bit() { return false; }
inline constexpr bool IsWindows64Bit() { return false; }
inline constexpr bool IsWindowsARM64() { return false; }
inline constexpr bool IsWindowsStoreBuild() { return false; }
inline bool IsWindows7OrGreater() { return false; }
inline bool IsWindows8OrGreater() { return false; }
Expand Down
1 change: 1 addition & 0 deletions base/platform/mac/base_info_mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ inline constexpr bool IsMacStoreBuild() {
inline constexpr bool IsWindows() { return false; }
inline constexpr bool IsWindows32Bit() { return false; }
inline constexpr bool IsWindows64Bit() { return false; }
inline constexpr bool IsWindowsARM64() { return false; }
inline constexpr bool IsWindowsStoreBuild() { return false; }
inline bool IsWindows7OrGreater() { return false; }
inline bool IsWindows8OrGreater() { return false; }
Expand Down
4 changes: 3 additions & 1 deletion base/platform/win/base_info_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,9 @@ int AutoUpdateVersion() {
}

QString AutoUpdateKey() {
if (IsWindows64Bit()) {
if (IsWindowsARM64()) {
return "winarm";
} else if (IsWindows64Bit()) {
return "win64";
} else {
return "win";
Expand Down
8 changes: 8 additions & 0 deletions base/platform/win/base_info_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ inline constexpr bool IsWindows64Bit() {
#endif // Q_PROCESSOR_X86_64
}

inline constexpr bool IsWindowsARM64() {
#ifdef Q_PROCESSOR_ARM_64
return true;
#else // Q_PROCESSOR_ARM_64
return false;
#endif // Q_PROCESSOR_ARM_64
}

inline constexpr bool IsWindowsStoreBuild() {
#ifdef OS_WIN_STORE
return true;
Expand Down

0 comments on commit 5463913

Please sign in to comment.