patch 8.1.1971: manually enabling features causes build errors
Problem: Manually enabling features causes build errors. (John Marriott)
Solution: Adjust #ifdefs.
diff --git a/src/buffer.c b/src/buffer.c
index 257ae7d..c42dece 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -45,10 +45,6 @@
static void free_buffer(buf_T *);
static void free_buffer_stuff(buf_T *buf, int free_options);
static void clear_wininfo(buf_T *buf);
-#if defined(FEAT_JOB_CHANNEL) \
- || defined(FEAT_PYTHON) || defined(FEAT_PYTHON3)
-static int find_win_for_buf(buf_T *buf, win_T **wp, tabpage_T **tp);
-#endif
#ifdef UNIX
# define dev_T dev_t
@@ -5457,7 +5453,24 @@
#if defined(FEAT_JOB_CHANNEL) \
|| defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) \
|| defined(PROTO)
-# define SWITCH_TO_WIN
+/*
+ * Find a window for buffer "buf".
+ * If found OK is returned and "wp" and "tp" are set to the window and tabpage.
+ * If not found FAIL is returned.
+ */
+ static int
+find_win_for_buf(
+ buf_T *buf,
+ win_T **wp,
+ tabpage_T **tp)
+{
+ FOR_ALL_TAB_WINDOWS(*tp, *wp)
+ if ((*wp)->w_buffer == buf)
+ goto win_found;
+ return FAIL;
+win_found:
+ return OK;
+}
/*
* Find a window that contains "buf" and switch to it.
@@ -5497,27 +5510,6 @@
}
#endif
-#if defined(FEAT_QUICKFIX) || defined(SWITCH_TO_WIN) || defined(PROTO)
-/*
- * Find a window for buffer "buf".
- * If found OK is returned and "wp" and "tp" are set to the window and tabpage.
- * If not found FAIL is returned.
- */
- static int
-find_win_for_buf(
- buf_T *buf,
- win_T **wp,
- tabpage_T **tp)
-{
- FOR_ALL_TAB_WINDOWS(*tp, *wp)
- if ((*wp)->w_buffer == buf)
- goto win_found;
- return FAIL;
-win_found:
- return OK;
-}
-#endif
-
/*
* Set 'buflisted' for curbuf to "on" and trigger autocommands if it changed.
*/