diff src/os_win32.c @ 15868:7fad90423bd2 v8.1.0941

patch 8.1.0941: macros for MS-Windows are inconsistent commit https://github.com/vim/vim/commit/4f97475d326c2773a78561fb874e4f23c25cbcd9 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Feb 17 17:44:42 2019 +0100 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)
author Bram Moolenaar <Bram@vim.org>
date Sun, 17 Feb 2019 17:45:08 +0100
parents 6ddcd10aa7af
children 907481b9260f
line wrap: on
line diff
--- 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 @@ typedef int LPSECURITY_ATTRIBUTES;
 # 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_working = 0;
 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 @@ static void reset_console_color_rgb(void
 # 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 char_u *exe_path = NULL;
 
 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 @@ get_build_number(void)
     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 @@ PlatformId(void)
     }
 }
 
-#ifndef FEAT_GUI_W32
+#ifndef FEAT_GUI_MSWIN
 
 #define SHIFT  (SHIFT_PRESSED)
 #define CTRL   (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED)
@@ -1122,7 +1122,7 @@ decode_key_event(
 # pragma optimize("", on)
 #endif
 
-#endif /* FEAT_GUI_W32 */
+#endif /* FEAT_GUI_MSWIN */
 
 
 #ifdef FEAT_MOUSE
@@ -1130,7 +1130,7 @@ decode_key_event(
 /*
  * 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 @@ decode_mouse_event(
     return TRUE;
 }
 
-# endif /* FEAT_GUI_W32 */
+# endif /* FEAT_GUI_MSWIN */
 #endif /* FEAT_MOUSE */
 
 
@@ -1481,7 +1481,7 @@ mch_update_cursor(void)
 }
 #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 @@ tgetch(int *pmodifiers, WCHAR *pch2)
 #endif
     }
 }
-#endif /* !FEAT_GUI_W32 */
+#endif /* !FEAT_GUI_MSWIN */
 
 
 /*
@@ -1793,7 +1793,7 @@ mch_inchar(
     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 @@ theend:
     }
     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 @@ bad_param_handler(const wchar_t *express
 # define SET_INVALID_PARAM_HANDLER
 #endif
 
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
 
 /*
  * GUI version of mch_init().
@@ -2196,7 +2196,7 @@ mch_init(void)
 }
 
 
-#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 @@ mch_exit(int r)
 
     exit(r);
 }
-#endif /* !FEAT_GUI_W32 */
+#endif /* !FEAT_GUI_MSWIN */
 
 /*
  * Do we have an interactive window?
@@ -2763,7 +2763,7 @@ mch_check_win(
 {
     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 @@ mch_free_acl(vim_acl_T acl)
 #endif
 }
 
-#ifndef FEAT_GUI_W32
+#ifndef FEAT_GUI_MSWIN
 
 /*
  * handler for ctrl-break, ctrl-c interrupts, and fatal events.
@@ -4168,7 +4168,7 @@ mch_set_winsize_now(void)
     }
     suppress_winsize = 0;
 }
-#endif /* FEAT_GUI_W32 */
+#endif /* FEAT_GUI_MSWIN */
 
     static BOOL
 vim_create_process(
@@ -4249,7 +4249,7 @@ vim_shell_execute(
 }
 
 
-#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 @@ mch_call_shell(
 	    else
 	    {
 		x = -1;
-#ifdef FEAT_GUI_W32
+#ifdef FEAT_GUI_MSWIN
 		emsg(_("E371: Command not found"));
 #endif
 	    }
@@ -5144,7 +5144,7 @@ mch_call_shell(
 	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 @@ mch_call_shell(
 	    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 @@ mch_call_shell(
 
     /* 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 @@ mch_clear_job(job_T *job)
 #endif
 
 
-#ifndef FEAT_GUI_W32
+#ifndef FEAT_GUI_MSWIN
 
 /*
  * Start termcap mode
@@ -5852,10 +5852,10 @@ termcap_mode_end(void)
 
     g_fTermcapMode = FALSE;
 }
-#endif /* FEAT_GUI_W32 */
-
-
-#ifdef FEAT_GUI_W32
+#endif /* FEAT_GUI_MSWIN */
+
+
+#ifdef FEAT_GUI_MSWIN
     void
 mch_write(
     char_u  *s UNUSED,
@@ -6692,7 +6692,7 @@ mch_write(
 #endif
 }
 
-#endif /* FEAT_GUI_W32 */
+#endif /* FEAT_GUI_MSWIN */
 
 
 /*
@@ -6703,7 +6703,7 @@ mch_delay(
     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 @@ mch_remove(char_u *name)
     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 @@ mch_setenv(char *var, char *value, int x
 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 @@ vtp_flag_init(void)
 
 }
 
-#if !defined(FEAT_GUI_W32) || defined(PROTO)
+#if !defined(FEAT_GUI_MSWIN) || defined(PROTO)
 
     static void
 vtp_init(void)
@@ -7941,7 +7941,7 @@ is_conpty_stable(void)
     return conpty_stable;
 }
 
-#if !defined(FEAT_GUI_W32) || defined(PROTO)
+#if !defined(FEAT_GUI_MSWIN) || defined(PROTO)
     void
 resize_console_buf(void)
 {