summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-09-22 14:11:50 +0200
committerBram Moolenaar <Bram@vim.org>2019-09-22 14:11:50 +0200
commit910c378d9342e0de8c6736c83ebdbbb597267056 (patch)
tree515694b8a4616de243649784c607cee409013f37
parentbd67aac279adf3a1cfa11557229b44e4c2c3dcda (diff)
downloadvim-git-910c378d9342e0de8c6736c83ebdbbb597267056.tar.gz
patch 8.1.2065: compiler warning building non-GUI with MinGW.v8.1.2065
Problem: Compiler warning building non-GUI with MinGW. Solution: Adjust #ifdefs. (Yegappan Lakshmanan, closes #4964)
-rw-r--r--src/mouse.c98
-rw-r--r--src/version.c2
2 files changed, 49 insertions, 51 deletions
diff --git a/src/mouse.c b/src/mouse.c
index f7a92a507..bf3973b02 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -15,8 +15,6 @@
#if defined(FEAT_MOUSE) || defined(PROTO)
-static int get_fpos_of_mouse(pos_T *mpos);
-
/*
* Get class of a character for selection: same class means same word.
* 0: blank
@@ -102,6 +100,52 @@ find_end_of_word(pos_T *pos)
}
}
+#if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) \
+ || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MSWIN) \
+ || defined(FEAT_GUI_MAC) || defined(FEAT_GUI_PHOTON) \
+ || defined(FEAT_TERM_POPUP_MENU)
+# define USE_POPUP_SETPOS
+# define NEED_VCOL2COL
+
+/*
+ * Translate window coordinates to buffer position without any side effects
+ */
+ static int
+get_fpos_of_mouse(pos_T *mpos)
+{
+ win_T *wp;
+ int row = mouse_row;
+ int col = mouse_col;
+
+ if (row < 0 || col < 0) // check if it makes sense
+ return IN_UNKNOWN;
+
+ // find the window where the row is in
+ wp = mouse_find_win(&row, &col, FAIL_POPUP);
+ if (wp == NULL)
+ return IN_UNKNOWN;
+ // winpos and height may change in win_enter()!
+ if (row >= wp->w_height) // In (or below) status line
+ return IN_STATUS_LINE;
+ if (col >= wp->w_width) // In vertical separator line
+ return IN_SEP_LINE;
+
+ if (wp != curwin)
+ return IN_UNKNOWN;
+
+ // compute the position in the buffer line from the posn on the screen
+ if (mouse_comp_pos(curwin, &row, &col, &mpos->lnum, NULL))
+ return IN_STATUS_LINE; // past bottom
+
+ mpos->col = vcol2col(wp, mpos->lnum, col);
+
+ if (mpos->col > 0)
+ --mpos->col;
+ mpos->coladd = 0;
+ return IN_BUFFER;
+}
+#endif
+
/*
* Do the appropriate action for the current mouse click in the current mode.
* Not used for Command-line mode.
@@ -469,10 +513,7 @@ do_mouse(
if (which_button == MOUSE_RIGHT
&& !(mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL)))
{
-#if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) \
- || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MSWIN) \
- || defined(FEAT_GUI_MAC) || defined(FEAT_GUI_PHOTON) \
- || defined(FEAT_TERM_POPUP_MENU)
+#ifdef USE_POPUP_SETPOS
# ifdef FEAT_GUI
if (gui.in_use)
{
@@ -2232,51 +2273,6 @@ mouse_find_win(int *rowp, int *colp, mouse_find_T popup UNUSED)
return NULL;
}
-#if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MAC) \
- || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MSWIN) \
- || defined(FEAT_GUI_PHOTON) || defined(FEAT_TERM_POPUP_MENU) \
- || defined(PROTO)
-# define NEED_VCOL2COL
-
-/*
- * Translate window coordinates to buffer position without any side effects
- */
- static int
-get_fpos_of_mouse(pos_T *mpos)
-{
- win_T *wp;
- int row = mouse_row;
- int col = mouse_col;
-
- if (row < 0 || col < 0) // check if it makes sense
- return IN_UNKNOWN;
-
- // find the window where the row is in
- wp = mouse_find_win(&row, &col, FAIL_POPUP);
- if (wp == NULL)
- return IN_UNKNOWN;
- // winpos and height may change in win_enter()!
- if (row >= wp->w_height) // In (or below) status line
- return IN_STATUS_LINE;
- if (col >= wp->w_width) // In vertical separator line
- return IN_SEP_LINE;
-
- if (wp != curwin)
- return IN_UNKNOWN;
-
- // compute the position in the buffer line from the posn on the screen
- if (mouse_comp_pos(curwin, &row, &col, &mpos->lnum, NULL))
- return IN_STATUS_LINE; // past bottom
-
- mpos->col = vcol2col(wp, mpos->lnum, col);
-
- if (mpos->col > 0)
- --mpos->col;
- mpos->coladd = 0;
- return IN_BUFFER;
-}
-#endif
-
#if defined(NEED_VCOL2COL) || defined(FEAT_BEVAL) || defined(FEAT_TEXT_PROP) \
|| defined(PROTO)
/*
diff --git a/src/version.c b/src/version.c
index ab5045c93..576ac2342 100644
--- a/src/version.c
+++ b/src/version.c
@@ -758,6 +758,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2065,
+/**/
2064,
/**/
2063,