summaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-01-20 18:39:30 +0100
committerBram Moolenaar <Bram@vim.org>2019-01-20 18:39:30 +0100
commitedce7420d044a503f38284188770efba87121bd6 (patch)
tree96cb82fbd48229305b85a06a9cf4cfa7f71e1fae /src/os_unix.c
parent10772307c4e5299ed45470f92779f089a00d841e (diff)
downloadvim-git-edce7420d044a503f38284188770efba87121bd6.tar.gz
patch 8.1.0787: compiler warning for unused functionv8.1.0787
Problem: Compiler warning for unused function. (Tony Mechelynck) Solution: Tune #ifdef around setjmp functions.
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 0a2682949..3919c1cf2 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -980,7 +980,11 @@ sig_alarm SIGDEFARG(sigarg)
}
#endif
-#if defined(HAVE_SETJMP_H) || defined(PROTO)
+#if (defined(HAVE_SETJMP_H) \
+ && ((defined(FEAT_X11) && defined(FEAT_XCLIPBOARD)) \
+ || defined(FEAT_LIBCALL))) \
+ || defined(PROTO)
+
// argument to SETJMP()
static JMP_BUF lc_jump_env;
@@ -7490,9 +7494,9 @@ setup_term_clip(void)
if (app_context != NULL && xterm_Shell == (Widget)0)
{
int (*oldhandler)();
-#if defined(HAVE_SETJMP_H)
+# if defined(HAVE_SETJMP_H)
int (*oldIOhandler)();
-#endif
+# endif
# ifdef ELAPSED_FUNC
elapsed_T start_tv;
@@ -7503,7 +7507,7 @@ setup_term_clip(void)
/* Ignore X errors while opening the display */
oldhandler = XSetErrorHandler(x_error_check);
-#if defined(HAVE_SETJMP_H)
+# if defined(HAVE_SETJMP_H)
/* Ignore X IO errors while opening the display */
oldIOhandler = XSetIOErrorHandler(x_IOerror_check);
mch_startjmp();
@@ -7513,21 +7517,21 @@ setup_term_clip(void)
xterm_dpy = NULL;
}
else
-#endif
+# endif
{
xterm_dpy = XtOpenDisplay(app_context, xterm_display,
"vim_xterm", "Vim_xterm", NULL, 0, &z, &strp);
if (xterm_dpy != NULL)
xterm_dpy_retry_count = 0;
-#if defined(HAVE_SETJMP_H)
+# if defined(HAVE_SETJMP_H)
mch_endjmp();
-#endif
+# endif
}
-#if defined(HAVE_SETJMP_H)
+# if defined(HAVE_SETJMP_H)
/* Now handle X IO errors normally. */
(void)XSetIOErrorHandler(oldIOhandler);
-#endif
+# endif
/* Now handle X errors normally. */
(void)XSetErrorHandler(oldhandler);