diff src/terminal.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 63e71d195cee
children f5620f490af2
line wrap: on
line diff
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -66,7 +66,7 @@ typedef struct sb_line_S {
     char_u	*sb_text;	// for tl_scrollback_postponed
 } sb_line_T;
 
-#ifdef WIN3264
+#ifdef MSWIN
 # ifndef HPCON
 #  define HPCON VOID*
 # endif
@@ -112,7 +112,7 @@ struct terminal_S {
 
     char_u	*tl_arg0_cmd;	// To format the status bar
 
-#ifdef WIN3264
+#ifdef MSWIN
     void	*tl_winpty_config;
     void	*tl_winpty;
 
@@ -172,7 +172,7 @@ static term_T *first_term = NULL;
 /* Terminal active in terminal_loop(). */
 static term_T *in_terminal_loop = NULL;
 
-#ifdef WIN3264
+#ifdef MSWIN
 static BOOL has_winpty = FALSE;
 static BOOL has_conpty = FALSE;
 #endif
@@ -324,7 +324,7 @@ init_job_options(jobopt_T *opt)
     static void
 setup_job_options(jobopt_T *opt, int rows, int cols)
 {
-#ifndef WIN3264
+#ifndef MSWIN
     /* Win32: Redirecting the job output won't work, thus always connect stdout
      * here. */
     if (!(opt->jo_set & JO_OUT_IO))
@@ -337,7 +337,7 @@ setup_job_options(jobopt_T *opt, int row
 	opt->jo_set |= JO_OUT_IO + JO_OUT_BUF + JO_OUT_MODIFIABLE;
     }
 
-#ifndef WIN3264
+#ifndef MSWIN
     /* Win32: Redirecting the job output won't work, thus always connect stderr
      * here. */
     if (!(opt->jo_set & JO_ERR_IO))
@@ -570,7 +570,7 @@ term_start(
     curbuf->b_p_ma = FALSE;
 
     set_term_and_win_size(term);
-#ifdef WIN3264
+#ifdef MSWIN
     mch_memmove(orig_opt.jo_io, opt->jo_io, sizeof(orig_opt.jo_io));
 #endif
     setup_job_options(opt, term->tl_rows, term->tl_cols);
@@ -748,7 +748,7 @@ ex_terminal(exarg_T *eap)
 	    vim_free(buf);
 	    *p = ' ';
 	}
-#ifdef WIN3264
+#ifdef MSWIN
 	else if ((int)(p - cmd) == 4 && STRNICMP(cmd, "type", 4) == 0
 								 && ep != NULL)
 	{
@@ -824,7 +824,7 @@ term_write_session(FILE *fd, win_T *wp)
     if (fprintf(fd, "terminal ++curwin ++cols=%d ++rows=%d ",
 		term->tl_cols, term->tl_rows) < 0)
 	return FAIL;
-#ifdef WIN3264
+#ifdef MSWIN
     if (fprintf(fd, "++type=%s ", term->tl_job->jv_tty_type) < 0)
 	return FAIL;
 #endif
@@ -932,7 +932,7 @@ free_unused_terminals()
 	vim_free(term->tl_opencmd);
 	vim_free(term->tl_eof_chars);
 	vim_free(term->tl_arg0_cmd);
-#ifdef WIN3264
+#ifdef MSWIN
 	if (term->tl_out_fd != NULL)
 	    fclose(term->tl_out_fd);
 #endif
@@ -1027,7 +1027,7 @@ write_to_term(buf_T *buffer, char_u *msg
     size_t	len = STRLEN(msg);
     term_T	*term = buffer->b_term;
 
-#ifdef WIN3264
+#ifdef MSWIN
     /* Win32: Cannot redirect output of the job, intercept it here and write to
      * the file. */
     if (term->tl_out_fd != NULL)
@@ -1471,7 +1471,7 @@ add_scrollback_line_to_buffer(term_T *te
     int		empty = (buf->b_ml.ml_flags & ML_EMPTY);
     linenr_T	lnum = buf->b_ml.ml_line_count;
 
-#ifdef WIN3264
+#ifdef MSWIN
     if (!enc_utf8 && enc_codepage > 0)
     {
 	WCHAR   *ret = NULL;
@@ -1875,7 +1875,7 @@ term_vgetc()
 
     State = TERMINAL;
     got_int = FALSE;
-#ifdef WIN3264
+#ifdef MSWIN
     ctrl_break_was_pressed = FALSE;
 #endif
     c = vgetc();
@@ -2016,7 +2016,7 @@ term_paste_register(int prev_c UNUSED)
 	for (item = l->lv_first; item != NULL; item = item->li_next)
 	{
 	    char_u *s = tv_get_string(&item->li_tv);
-#ifdef WIN3264
+#ifdef MSWIN
 	    char_u *tmp = s;
 
 	    if (!enc_utf8 && enc_codepage > 0)
@@ -2036,7 +2036,7 @@ term_paste_register(int prev_c UNUSED)
 #endif
 	    channel_send(curbuf->b_term->tl_job->jv_channel, PART_IN,
 						      s, (int)STRLEN(s), NULL);
-#ifdef WIN3264
+#ifdef MSWIN
 	    if (tmp != s)
 		vim_free(s);
 #endif
@@ -2293,7 +2293,7 @@ terminal_loop(int blocking)
 	}
 #endif
 
-#ifdef WIN3264
+#ifdef MSWIN
 	/* On Windows winpty handles CTRL-C, don't send a CTRL_C_EVENT.
 	 * Use CTRL-BREAK to kill the job. */
 	if (ctrl_break_was_pressed)
@@ -2370,7 +2370,7 @@ terminal_loop(int blocking)
 		goto theend;
 	    }
 	}
-# ifdef WIN3264
+# ifdef MSWIN
 	if (!enc_utf8 && has_mbyte && c >= 0x80)
 	{
 	    WCHAR   wc;
@@ -2719,7 +2719,7 @@ handle_settermprop(
 	    // Empty corrupted data of winpty
 	    else if (STRNCMP("  - ", (char_u *)value->string, 4) == 0)
 		term->tl_title = NULL;
-#ifdef WIN3264
+#ifdef MSWIN
 	    else if (!enc_utf8 && enc_codepage > 0)
 	    {
 		WCHAR   *ret = NULL;
@@ -3072,7 +3072,7 @@ term_channel_closed(channel_T *ch)
 
 	    VIM_CLEAR(term->tl_title);
 	    VIM_CLEAR(term->tl_status_text);
-#ifdef WIN3264
+#ifdef MSWIN
 	    if (term->tl_out_fd != NULL)
 	    {
 		fclose(term->tl_out_fd);
@@ -3184,7 +3184,7 @@ term_line2screenline(VTermScreen *screen
 		    ScreenLinesUC[off] = NUL;
 		}
 	    }
-#ifdef WIN3264
+#ifdef MSWIN
 	    else if (has_mbyte && c >= 0x80)
 	    {
 		char_u	mb[MB_MAXBYTES+1];
@@ -3557,7 +3557,7 @@ init_default_colors(term_T *term)
     }
     else
     {
-#if defined(WIN3264) && !defined(FEAT_GUI_W32)
+#if defined(MSWIN) && !defined(FEAT_GUI_MSWIN)
 	int tmp;
 #endif
 
@@ -3565,7 +3565,7 @@ init_default_colors(term_T *term)
 	if (cterm_normal_fg_color > 0)
 	{
 	    cterm_color2vterm(cterm_normal_fg_color - 1, fg);
-# if defined(WIN3264) && !defined(FEAT_GUI_W32)
+# if defined(MSWIN) && !defined(FEAT_GUI_MSWIN)
 	    tmp = fg->red;
 	    fg->red = fg->blue;
 	    fg->blue = tmp;
@@ -3579,7 +3579,7 @@ init_default_colors(term_T *term)
 	if (cterm_normal_bg_color > 0)
 	{
 	    cterm_color2vterm(cterm_normal_bg_color - 1, bg);
-# if defined(WIN3264) && !defined(FEAT_GUI_W32)
+# if defined(MSWIN) && !defined(FEAT_GUI_MSWIN)
 	    tmp = bg->red;
 	    bg->red = bg->blue;
 	    bg->blue = tmp;
@@ -3922,7 +3922,7 @@ create_vterm(term_T *term, int rows, int
     /* For unix do not use a blinking cursor.  In an xterm this causes the
      * cursor to blink if it's blinking in the xterm.
      * For Windows we respect the system wide setting. */
-#ifdef WIN3264
+#ifdef MSWIN
     if (GetCaretBlinkTime() == INFINITE)
 	value.boolean = 0;
     else
@@ -5588,7 +5588,7 @@ term_send_eof(channel_T *ch)
 					(int)STRLEN(term->tl_eof_chars), NULL);
 		channel_send(ch, PART_IN, (char_u *)"\r", 1, NULL);
 	    }
-# ifdef WIN3264
+# ifdef MSWIN
 	    else
 		/* Default: CTRL-D */
 		channel_send(ch, PART_IN, (char_u *)"\004\r", 2, NULL);
@@ -5604,7 +5604,7 @@ term_getjob(term_T *term)
 }
 #endif
 
-# if defined(WIN3264) || defined(PROTO)
+# if defined(MSWIN) || defined(PROTO)
 
 /**************************************
  * 2. MS-Windows implementation.