Patch 8.2.5021
Problem:    Build fails with normal features and +terminal. (Dominique Pellé)
Solution:   Add #ifdefs. (closes #10484)
Files:      src/terminal.c


*** ../vim-8.2.5020/src/terminal.c      2022-05-20 10:10:29.948122642 +0100
--- src/terminal.c      2022-05-26 14:02:53.849793900 +0100
***************
*** 244,268 ****
      return (color == NULL) ? (char_u *)"" : color;
  }
  
- /*
-  * Return TRUE if the user-defined palette (either g:terminal_ansi_colors or 
the
-  * "ansi_colors" argument in term_start()) shall be applied.
-  */
-     static int
- term_use_palette()
- {
-     if (0
- #ifdef FEAT_GUI
-           || gui.in_use
- #endif
- #ifdef FEAT_TERMGUICOLORS
-           || p_tgc
- #endif
-        )
-       return TRUE;
-     return FALSE;
- }
- 
  
  /*
   * Parse 'termwinsize' and set "rows" and "cols" for the terminal size in the
--- 244,249 ----
***************
*** 726,731 ****
--- 707,713 ----
      if (opt->jo_set2 & JO2_TERM_HIGHLIGHT)
        term->tl_highlight_name = vim_strsave(opt->jo_term_highlight);
  
+ #if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
      // Save the user-defined palette, it is only used in GUI (or 'tgc' is on).
      if (opt->jo_set2 & JO2_ANSI_COLORS)
      {
***************
*** 737,742 ****
--- 719,725 ----
        }
        memcpy(term->tl_palette, opt->jo_ansi_colors, sizeof(long_u) * 16);
      }
+ #endif
  
      // System dependent: setup the vterm and maybe start the job in it.
      if (argv == NULL
***************
*** 4215,4220 ****
--- 4198,4222 ----
  
  #if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
  /*
+  * Return TRUE if the user-defined palette (either g:terminal_ansi_colors or 
the
+  * "ansi_colors" argument in term_start()) shall be applied.
+  */
+     static int
+ term_use_palette()
+ {
+     if (0
+ #ifdef FEAT_GUI
+           || gui.in_use
+ #endif
+ #ifdef FEAT_TERMGUICOLORS
+           || p_tgc
+ #endif
+        )
+       return TRUE;
+     return FALSE;
+ }
+ 
+ /*
   * Set the 16 ANSI colors from array of RGB values
   */
      static void
***************
*** 4744,4753 ****
      static void
  term_update_palette(term_T *term)
  {
      if (term_use_palette()
            && (term->tl_palette != NULL
                || find_var((char_u *)"g:terminal_ansi_colors", NULL, TRUE)
!               != NULL))
      {
        if (term->tl_palette != NULL)
            set_vterm_palette(term->tl_vterm, term->tl_palette);
--- 4746,4756 ----
      static void
  term_update_palette(term_T *term)
  {
+ #if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
      if (term_use_palette()
            && (term->tl_palette != NULL
                || find_var((char_u *)"g:terminal_ansi_colors", NULL, TRUE)
!                                                                     != NULL))
      {
        if (term->tl_palette != NULL)
            set_vterm_palette(term->tl_vterm, term->tl_palette);
***************
*** 4755,4760 ****
--- 4758,4764 ----
            init_vterm_ansi_colors(term->tl_vterm);
      }
      else
+ #endif
        term_reset_palette(term->tl_vterm);
  }
  
***************
*** 6939,6944 ****
--- 6943,6949 ----
      if (create_vterm(term, term->tl_rows, term->tl_cols) == FAIL)
        goto failed;
  
+ #if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
      if (term_use_palette())
      {
        if (term->tl_palette != NULL)
***************
*** 6946,6951 ****
--- 6951,6957 ----
        else
            init_vterm_ansi_colors(term->tl_vterm);
      }
+ #endif
  
      channel_set_job(channel, job, opt);
      job_set_options(job, opt);
***************
*** 7271,7276 ****
--- 7277,7283 ----
      if (create_vterm(term, term->tl_rows, term->tl_cols) == FAIL)
        goto failed;
  
+ #if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
      if (term_use_palette())
      {
        if (term->tl_palette != NULL)
***************
*** 7278,7283 ****
--- 7285,7291 ----
        else
            init_vterm_ansi_colors(term->tl_vterm);
      }
+ #endif
  
      channel_set_job(channel, job, opt);
      job_set_options(job, opt);
***************
*** 7531,7536 ****
--- 7539,7545 ----
      if (create_vterm(term, term->tl_rows, term->tl_cols) == FAIL)
        return FAIL;
  
+ #if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
      if (term_use_palette())
      {
        if (term->tl_palette != NULL)
***************
*** 7538,7543 ****
--- 7547,7553 ----
        else
            init_vterm_ansi_colors(term->tl_vterm);
      }
+ #endif
  
      // This may change a string in "argvar".
      term->tl_job = job_start(argvar, argv, opt, &term->tl_job);
*** ../vim-8.2.5020/src/version.c       2022-05-26 13:16:21.523092837 +0100
--- src/version.c       2022-05-26 14:06:22.353682692 +0100
***************
*** 736,737 ****
--- 736,739 ----
  {   /* Add new patch number below this line */
+ /**/
+     5021,
  /**/

-- 
Even got a Datapoint 3600(?) with a DD50 connector instead of the
usual DB25...  what a nightmare trying to figure out the pinout
for *that* with no spex...

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220526130716.57C0D1C14D9%40moolenaar.net.

Raspunde prin e-mail lui