emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 864a4dc2363: Fix compilation of w32.c with old MinGW system hea


From: Eli Zaretskii
Subject: emacs-29 864a4dc2363: Fix compilation of w32.c with old MinGW system headers
Date: Thu, 13 Apr 2023 01:18:44 -0400 (EDT)

branch: emacs-29
commit 864a4dc236395e441aafd23b9cbca099afdc5324
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Fix compilation of w32.c with old MinGW system headers
    
    * src/w32.c (CONSOLE_FONT_INFO): Make sure the definition is not
    visible for MinGW versions whose w32api's version is before 5.2.0.
    (Bug#52792)
---
 src/w32.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/w32.c b/src/w32.c
index 8d344d2e6da..a6bc0f4b2ee 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -543,7 +543,14 @@ typedef LANGID (WINAPI *GetUserDefaultUILanguage_Proc) 
(void);
 
 typedef COORD (WINAPI *GetConsoleFontSize_Proc) (HANDLE, DWORD);
 
-#if _WIN32_WINNT < 0x0501
+/* Old versions of mingw.org's MinGW, before v5.2.0, don't have a
+   _WIN32_WINNT guard for CONSOLE_FONT_INFO in wincon.h, and so don't
+   need the conditional definition below, which causes compilation
+   errors.  Note: MinGW64 sets _WIN32_WINNT to a higher version, and
+   its w32api.h version stays fixed at 3.14.  */
+#if _WIN32_WINNT < 0x0501 \
+    && (__W32API_MAJOR_VERSION > 5 \
+       || (__W32API_MAJOR_VERSION == 5 && __W32API_MINOR_VERSION >= 2))
 typedef struct
 {
   DWORD nFont;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]