Skip to content

Commit

Permalink
[libwin32common] rp_versionhelpers.h: AppVeyor's Windows 7 SDK didn't…
Browse files Browse the repository at this point in the history
… like these redefinitions.

Hard-code the version numbers, again...
  • Loading branch information
GerbilSoft committed Jul 17, 2023
1 parent 6aab712 commit 7a0ae67
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions src/libwin32common/rp_versionhelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,10 @@

#include "RpWin32_sdk.h"

// Newer Windows version definitions for the Windows 7 SDK
#ifndef _WIN32_WINNT_WIN8
# define _WIN32_WINNT_WIN8 0x0602
#endif
#ifndef _WIN32_WINNT_WINBLUE
# define _WIN32_WINNT_WINBLUE 0x0603
#endif
#ifndef _WIN32_WINNT_WINTHRESHOLD
# define _WIN32_WINNT_WINTHRESHOLD 0x0A00
#endif

#ifdef __cplusplus
# define VERSIONHELPERAPI inline bool
#define VERSIONHELPERAPI inline bool
#else
# define VERSIONHELPERAPI FORCEINLINE BOOL
#define VERSIONHELPERAPI FORCEINLINE BOOL
#endif

VERSIONHELPERAPI IsWindowsVersionOrGreater(WORD major, WORD minor, WORD servpack)
Expand Down Expand Up @@ -75,14 +64,22 @@ VERSIONHELPERAPI IsWindows7SP1OrGreater(void) {
}

VERSIONHELPERAPI IsWindows8OrGreater(void) {
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN8), LOBYTE(_WIN32_WINNT_WIN8), 0);
// FIXME: _WIN32_WINNT_WIN8 is missing when building with the Windows 7 SDK.
// Defining it causes a lot of other things to break for some reason...
//return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN8), LOBYTE(_WIN32_WINNT_WIN8), 0);
return IsWindowsVersionOrGreater(HIBYTE(0x0602), LOBYTE(0x0602), 0);
}

VERSIONHELPERAPI IsWindows8Point1OrGreater(void) {
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINBLUE), LOBYTE(_WIN32_WINNT_WINBLUE), 0);
// FIXME: _WIN32_WINNT_WINBLUE is missing when building with the Windows 7 SDK.
// Defining it causes a lot of other things to break for some reason...
//return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINBLUE), LOBYTE(_WIN32_WINNT_WINBLUE), 0);
return IsWindowsVersionOrGreater(HIBYTE(0x0603), LOBYTE(0x0603), 0);
}

VERSIONHELPERAPI IsWindowsThresholdOrGreater(void) {
// FIXME: _WIN32_WINNT_WINTHRESHOLD is missing when building with MSVC 2022 for some reason.
//return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINTHRESHOLD), LOBYTE(_WIN32_WINNT_WINTHRESHOLD), 0);
return IsWindowsVersionOrGreater(HIBYTE(0x0A00), LOBYTE(0x0A00), 0);
}

Expand Down

0 comments on commit 7a0ae67

Please sign in to comment.