]> git.eshelyaron.com Git - emacs.git/commitdiff
; Fix last change to compile with mingw.org's MinGW
authorEli Zaretskii <eliz@gnu.org>
Thu, 14 Mar 2024 08:22:52 +0000 (10:22 +0200)
committerEshel Yaron <me@eshelyaron.com>
Fri, 15 Mar 2024 08:59:23 +0000 (09:59 +0100)
* 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
src/w32xfns.c

index 3e4a8c475b754afb1449acfebb5e0582839d7847..7d288ce7bd5e49b00bde811f959f78978716328b 100644 (file)
@@ -47,6 +47,13 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 #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 <mbstring.h>
 #include <mbctype.h>   /* for _getmbcp */
 #include <wtsapi32.h>  /* for WTS(Un)RegisterSessionNotification */
index 3d7a1514f72ac77127bf8d19add78d43dae04572..853c8368118a12082cd0b3664bcbbb6ec903f73b 100644 (file)
@@ -22,6 +22,17 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 #include <stdio.h>
 #include <windows.h>
 #include <windowsx.h>
+/* 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 <wtsapi32.h>  /* for WM_WTSSESSION_CHANGE, WTS_SESSION_LOCK */
 
 #include "lisp.h"
 #include "frame.h"