diff src/structs.h @ 12477:68d7bc045dbe v8.0.1118

patch 8.0.1118: FEAT_WINDOWS adds a lot of #ifdefs commit https://github.com/vim/vim/commit/4033c55eca575777718c0701e26635a0cc47d907 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 16 20:54:51 2017 +0200 patch 8.0.1118: FEAT_WINDOWS adds a lot of #ifdefs Problem: FEAT_WINDOWS adds a lot of #ifdefs while it is nearly always enabled and only adds 7% to the binary size of the tiny build. Solution: Graduate FEAT_WINDOWS.
author Christian Brabandt <cb@256bit.org>
date Sat, 16 Sep 2017 21:00:06 +0200
parents d0cf7f71b95b
children 3f16cf18386c
line wrap: on
line diff
--- a/src/structs.h
+++ b/src/structs.h
@@ -205,13 +205,11 @@ typedef struct
     long	wo_nuw;
 # define w_p_nuw w_onebuf_opt.wo_nuw	/* 'numberwidth' */
 #endif
-#if defined(FEAT_WINDOWS)
     int		wo_wfh;
 # define w_p_wfh w_onebuf_opt.wo_wfh	/* 'winfixheight' */
     int		wo_wfw;
 # define w_p_wfw w_onebuf_opt.wo_wfw	/* 'winfixwidth' */
-#endif
-#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+#if defined(FEAT_QUICKFIX)
     int		wo_pvw;
 # define w_p_pvw w_onebuf_opt.wo_pvw	/* 'previewwindow' */
 #endif
@@ -570,10 +568,8 @@ typedef struct
 # ifdef FEAT_BROWSE_CMD
     int		browse;			/* TRUE to invoke file dialog */
 # endif
-# ifdef FEAT_WINDOWS
     int		split;			/* flags for win_split() */
     int		tab;			/* > 0 when ":tab" was used */
-# endif
 # if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
     int		confirm;		/* TRUE to invoke yes/no dialog */
 # endif
@@ -728,11 +724,7 @@ typedef struct argentry
     int		ae_fnum;	/* buffer number with expanded file name */
 } aentry_T;
 
-#ifdef FEAT_WINDOWS
-# define ALIST(win) (win)->w_alist
-#else
-# define ALIST(win) (&global_alist)
-#endif
+#define ALIST(win)	(win)->w_alist
 #define GARGLIST	((aentry_T *)global_alist.al_ga.ga_data)
 #define ARGLIST		((aentry_T *)ALIST(curwin)->al_ga.ga_data)
 #define WARGLIST(wp)	((aentry_T *)ALIST(wp)->al_ga.ga_data)
@@ -2531,10 +2523,8 @@ typedef struct w_line
 struct frame_S
 {
     char	fr_layout;	/* FR_LEAF, FR_COL or FR_ROW */
-#ifdef FEAT_WINDOWS
     int		fr_width;
     int		fr_newwidth;	/* new width used in win_equal_rec() */
-#endif
     int		fr_height;
     int		fr_newheight;	/* new height used in win_equal_rec() */
     frame_T	*fr_parent;	/* containing frame or NULL */
@@ -2637,10 +2627,8 @@ struct window_S
     synblock_T	*w_s;		    /* for :ownsyntax */
 #endif
 
-#ifdef FEAT_WINDOWS
     win_T	*w_prev;	    /* link to previous window */
     win_T	*w_next;	    /* link to next window */
-#endif
 #ifdef FEAT_AUTOCMD
     int		w_closing;	    /* window is being closed, don't let
 				       autocommands close it too. */
@@ -2696,12 +2684,9 @@ struct window_S
      * Layout of the window in the screen.
      * May need to add "msg_scrolled" to "w_winrow" in rare situations.
      */
-#ifdef FEAT_WINDOWS
     int		w_winrow;	    /* first row of window in screen */
-#endif
     int		w_height;	    /* number of rows in window, excluding
 				       status/command line(s) */
-#ifdef FEAT_WINDOWS
     int		w_status_height;    /* number of status lines (0 or 1) */
     int		w_wincol;	    /* Leftmost column of window in screen.
 				       use W_WINCOL() */
@@ -2709,8 +2694,6 @@ struct window_S
 				       use W_WIDTH() */
     int		w_vsep_width;	    /* Number of separator columns (0 or 1).
 				       use W_VSEP_WIDTH() */
-#endif
-
     /*
      * === start of cached values ====
      */
@@ -2792,9 +2775,7 @@ struct window_S
 				       w_redr_type is REDRAW_TOP */
     linenr_T	w_redraw_top;	    /* when != 0: first line needing redraw */
     linenr_T	w_redraw_bot;	    /* when != 0: last line needing redraw */
-#ifdef FEAT_WINDOWS
     int		w_redr_status;	    /* if TRUE status line must be redrawn */
-#endif
 
 #ifdef FEAT_CMDL_INFO
     /* remember what is shown in the ruler for this window (if 'ruler' set) */
@@ -2810,9 +2791,7 @@ struct window_S
 
     int		w_alt_fnum;	    /* alternate file (for # and CTRL-^) */
 
-#ifdef FEAT_WINDOWS
     alist_T	*w_alist;	    /* pointer to arglist for this window */
-#endif
     int		w_arg_idx;	    /* current index in argument list (can be
 				       out of range!) */
     int		w_arg_idx_invalid;  /* editing another file than w_arg_idx */
@@ -3346,10 +3325,8 @@ typedef struct
 #ifdef FEAT_EVAL
     int		use_debug_break_level;
 #endif
-#ifdef FEAT_WINDOWS
     int		window_count;		/* number of windows to use */
     int		window_layout;		/* 0, WIN_HOR, WIN_VER or WIN_TABS */
-#endif
 
 #ifdef FEAT_CLIENTSERVER
     int		serverArg;		/* TRUE when argument for a server */