From 2284fecf959a08dc0ca5c5a68918c00d9a3eb0db Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 14 Mar 2024 10:22:52 +0200 Subject: [PATCH] ; Fix last change to compile with mingw.org's MinGW * src/w32xfns.c: * src/w32fns.c (WTS_VIRTUAL_CLASS) [!MINGW_W64]: Declare. * src/w32xfns.c: Include wtsapi32.h. (cherry picked from commit 7971537d3cdab62f7ce1924cbb2effde73b59b1e) --- src/w32fns.c | 7 +++++++ src/w32xfns.c | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/w32fns.c b/src/w32fns.c index 3e4a8c475b7..7d288ce7bd5 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -47,6 +47,13 @@ along with GNU Emacs. If not, see . */ #include "w32inevt.h" #ifdef WINDOWSNT +/* mingw.org's MinGW headers mistakenly omit this enumeration: */ +# ifndef MINGW_W64 +typedef enum _WTS_VIRTUAL_CLASS { + WTSVirtualClientData, + WTSVirtualFileHandle +} WTS_VIRTUAL_CLASS; +# endif #include #include /* for _getmbcp */ #include /* for WTS(Un)RegisterSessionNotification */ diff --git a/src/w32xfns.c b/src/w32xfns.c index 3d7a1514f72..853c8368118 100644 --- a/src/w32xfns.c +++ b/src/w32xfns.c @@ -22,6 +22,17 @@ along with GNU Emacs. If not, see . */ #include #include #include +/* Override API version to get the required functionality. */ +#undef _WIN32_WINNT +#define _WIN32_WINNT 0x0501 +/* mingw.org's MinGW headers mistakenly omit this enumeration: */ +# ifndef MINGW_W64 +typedef enum _WTS_VIRTUAL_CLASS { + WTSVirtualClientData, + WTSVirtualFileHandle +} WTS_VIRTUAL_CLASS; +# endif +#include /* for WM_WTSSESSION_CHANGE, WTS_SESSION_LOCK */ #include "lisp.h" #include "frame.h" -- 2.39.5