From 2cd0e956bd8e7ebd2cc61858454ece505c9e09fa Mon Sep 17 00:00:00 2001 From: Moonchild Date: Sat, 7 Feb 2026 13:27:39 +0100 Subject: [PATCH] Issue #2909 - Fix build issues when targeting Windows 7. Despite Windows 7 supporting Tablet Mode and screen orientation just fine (I had a Win 7 tablet PC back when), Microsoft decided that starting with the Windows SDK 10.0.22621.0, the enum and types for auto-rotation should no longer be defined, so we have to define them ourselves. --- widget/windows/WinUtils.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/widget/windows/WinUtils.h b/widget/windows/WinUtils.h index 23e910db21..5fa2dbd9f7 100644 --- a/widget/windows/WinUtils.h +++ b/widget/windows/WinUtils.h @@ -37,6 +37,28 @@ #include "mozilla/EventForwards.h" #include "mozilla/UniquePtr.h" +// Starting with version 10.0.22621.0 of the Windows SDK the AR_STATE enum and +// types are only defined when building for Windows 8 instead of Windows 7. +#if (WDK_NTDDI_VERSION >= 0x0A00000C) && (WINVER < 0x0602) + +enum tagAR_STATE { + AR_ENABLED = 0x0, + AR_DISABLED = 0x1, + AR_SUPPRESSED = 0x2, + AR_REMOTESESSION = 0x4, + AR_MULTIMON = 0x8, + AR_NOSENSOR = 0x10, + AR_NOT_SUPPORTED = 0x20, + AR_DOCKED = 0x40, + AR_LAPTOP = 0x80 +}; + +typedef enum tagAR_STATE AR_STATE; + +using PAR_STATE = enum tagAR_STATE*; + +#endif // (WDK_NTDDI_VERSION >= 0x0A00000C) && (WINVER < 0x0602) + /** * NS_INLINE_DECL_IUNKNOWN_REFCOUNTING should be used for defining and * implementing AddRef() and Release() of IUnknown interface.