patch 8.1.0941: macros for MS-Windows are inconsistent
Problem: Macros for MS-Windows are inconsistent, using "32", "3264 and
others.
Solution: Use MSWIN for all MS-Windows builds. Use FEAT_GUI_MSWIN for the
GUI build. (Hirohito Higashi, closes #3932)
diff --git a/src/os_win32.c b/src/os_win32.c
index a392d13..b923315 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -10,7 +10,7 @@
* os_win32.c
*
* Used for both the console version and the Win32 GUI. A lot of code is for
- * the console version only, so there is a lot of "#ifndef FEAT_GUI_W32".
+ * the console version only, so there is a lot of "#ifndef FEAT_GUI_MSWIN".
*
* Win32 (Windows NT and Windows 95) system-dependent routines.
* Portions lifted from the Win32 SDK samples, the MSDOS-dependent code,
@@ -45,7 +45,7 @@
#endif
#ifndef PROTO
-# if defined(FEAT_TITLE) && !defined(FEAT_GUI_W32)
+# if defined(FEAT_TITLE) && !defined(FEAT_GUI_MSWIN)
# include <shellapi.h>
# endif
#endif
@@ -151,7 +151,7 @@
# define wcsicmp(a, b) wcscmpi((a), (b))
#endif
-#ifndef FEAT_GUI_W32
+#ifndef FEAT_GUI_MSWIN
/* Win32 Console handles for input and output */
static HANDLE g_hConIn = INVALID_HANDLE_VALUE;
static HANDLE g_hConOut = INVALID_HANDLE_VALUE;
@@ -193,7 +193,7 @@
static int conpty_stable = 0;
static void vtp_flag_init();
-#ifndef FEAT_GUI_W32
+#ifndef FEAT_GUI_MSWIN
static int vtp_working = 0;
static void vtp_init();
static void vtp_exit();
@@ -227,7 +227,7 @@
# define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
#endif
-#ifndef FEAT_GUI_W32
+#ifndef FEAT_GUI_MSWIN
static int suppress_winsize = 1; /* don't fiddle with console */
#endif
@@ -235,7 +235,7 @@
static BOOL win8_or_later = FALSE;
-#ifndef FEAT_GUI_W32
+#ifndef FEAT_GUI_MSWIN
/* Dynamic loading for portability */
typedef struct _DYN_CONSOLE_SCREEN_BUFFER_INFOEX
{
@@ -284,7 +284,7 @@
return ver;
}
-#ifndef FEAT_GUI_W32
+#ifndef FEAT_GUI_MSWIN
/*
* Version of ReadConsoleInput() that works with IME.
* Works around problems on Windows 8.
@@ -830,7 +830,7 @@
}
}
-#ifndef FEAT_GUI_W32
+#ifndef FEAT_GUI_MSWIN
#define SHIFT (SHIFT_PRESSED)
#define CTRL (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED)
@@ -1122,7 +1122,7 @@
# pragma optimize("", on)
#endif
-#endif /* FEAT_GUI_W32 */
+#endif /* FEAT_GUI_MSWIN */
#ifdef FEAT_MOUSE
@@ -1130,7 +1130,7 @@
/*
* For the GUI the mouse handling is in gui_w32.c.
*/
-# ifdef FEAT_GUI_W32
+# ifdef FEAT_GUI_MSWIN
void
mch_setmouse(int on UNUSED)
{
@@ -1441,7 +1441,7 @@
return TRUE;
}
-# endif /* FEAT_GUI_W32 */
+# endif /* FEAT_GUI_MSWIN */
#endif /* FEAT_MOUSE */
@@ -1481,7 +1481,7 @@
}
#endif
-#ifndef FEAT_GUI_W32 /* this isn't used for the GUI */
+#ifndef FEAT_GUI_MSWIN /* this isn't used for the GUI */
/*
* Handle FOCUS_EVENT.
*/
@@ -1775,7 +1775,7 @@
#endif
}
}
-#endif /* !FEAT_GUI_W32 */
+#endif /* !FEAT_GUI_MSWIN */
/*
@@ -1793,7 +1793,7 @@
long time UNUSED,
int tb_change_cnt UNUSED)
{
-#ifndef FEAT_GUI_W32 /* this isn't used for the GUI */
+#ifndef FEAT_GUI_MSWIN /* this isn't used for the GUI */
int len;
int c;
@@ -2006,9 +2006,9 @@
}
return len;
-#else /* FEAT_GUI_W32 */
+#else /* FEAT_GUI_MSWIN */
return 0;
-#endif /* FEAT_GUI_W32 */
+#endif /* FEAT_GUI_MSWIN */
}
#ifndef PROTO
@@ -2123,7 +2123,7 @@
# define SET_INVALID_PARAM_HANDLER
#endif
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
/*
* GUI version of mch_init().
@@ -2196,7 +2196,7 @@
}
-#else /* FEAT_GUI_W32 */
+#else /* FEAT_GUI_MSWIN */
#define SRWIDTH(sr) ((sr).Right - (sr).Left + 1)
#define SRHEIGHT(sr) ((sr).Bottom - (sr).Top + 1)
@@ -2751,7 +2751,7 @@
exit(r);
}
-#endif /* !FEAT_GUI_W32 */
+#endif /* !FEAT_GUI_MSWIN */
/*
* Do we have an interactive window?
@@ -2763,7 +2763,7 @@
{
get_exe_name();
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
return OK; /* GUI always has a tty */
#else
if (isatty(1))
@@ -3852,7 +3852,7 @@
#endif
}
-#ifndef FEAT_GUI_W32
+#ifndef FEAT_GUI_MSWIN
/*
* handler for ctrl-break, ctrl-c interrupts, and fatal events.
@@ -4168,7 +4168,7 @@
}
suppress_winsize = 0;
}
-#endif /* FEAT_GUI_W32 */
+#endif /* FEAT_GUI_MSWIN */
static BOOL
vim_create_process(
@@ -4249,7 +4249,7 @@
}
-#if defined(FEAT_GUI_W32) || defined(PROTO)
+#if defined(FEAT_GUI_MSWIN) || defined(PROTO)
/*
* Specialised version of system() for Win32 GUI mode.
@@ -5124,7 +5124,7 @@
else
{
x = -1;
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
emsg(_("E371: Command not found"));
#endif
}
@@ -5144,7 +5144,7 @@
else
{
cmdlen = (
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
(!p_stmp ? 0 : STRLEN(vimrun_path)) +
#endif
STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10);
@@ -5152,7 +5152,7 @@
newcmd = lalloc(cmdlen, TRUE);
if (newcmd != NULL)
{
-#if defined(FEAT_GUI_W32)
+#if defined(FEAT_GUI_MSWIN)
if (need_vimrun_warning)
{
char *msg = _("VIMRUN.EXE not found in your $PATH.\n"
@@ -5196,7 +5196,7 @@
/* Print the return value, unless "vimrun" was used. */
if (x != 0 && !(options & SHELL_SILENT) && !emsg_silent
-#if defined(FEAT_GUI_W32)
+#if defined(FEAT_GUI_MSWIN)
&& ((options & SHELL_DOOUT) || s_dont_use_vimrun || !p_stmp)
#endif
)
@@ -5736,7 +5736,7 @@
#endif
-#ifndef FEAT_GUI_W32
+#ifndef FEAT_GUI_MSWIN
/*
* Start termcap mode
@@ -5852,10 +5852,10 @@
g_fTermcapMode = FALSE;
}
-#endif /* FEAT_GUI_W32 */
+#endif /* FEAT_GUI_MSWIN */
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
void
mch_write(
char_u *s UNUSED,
@@ -6692,7 +6692,7 @@
#endif
}
-#endif /* FEAT_GUI_W32 */
+#endif /* FEAT_GUI_MSWIN */
/*
@@ -6703,7 +6703,7 @@
long msec,
int ignoreinput UNUSED)
{
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
Sleep((int)msec); /* never wait for input */
#else /* Console */
if (ignoreinput)
@@ -6771,7 +6771,7 @@
void
mch_breakcheck(int force)
{
-#ifndef FEAT_GUI_W32 /* never used */
+#ifndef FEAT_GUI_MSWIN /* never used */
if (g_fCtrlCPressed || g_fCBrkPressed)
{
ctrl_break_was_pressed = g_fCBrkPressed;
@@ -7696,7 +7696,7 @@
vtp_flag_init(void)
{
DWORD ver = get_build_number();
-#ifndef FEAT_GUI_W32
+#ifndef FEAT_GUI_MSWIN
DWORD mode;
HANDLE out;
@@ -7716,7 +7716,7 @@
}
-#if !defined(FEAT_GUI_W32) || defined(PROTO)
+#if !defined(FEAT_GUI_MSWIN) || defined(PROTO)
static void
vtp_init(void)
@@ -7941,7 +7941,7 @@
return conpty_stable;
}
-#if !defined(FEAT_GUI_W32) || defined(PROTO)
+#if !defined(FEAT_GUI_MSWIN) || defined(PROTO)
void
resize_console_buf(void)
{