summaryrefslogtreecommitdiff
path: root/src/if_cscope.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-09-05 23:04:02 +0200
committerBram Moolenaar <Bram@vim.org>2019-09-05 23:04:02 +0200
commit6f72e90dd843a7342395b31f31c2073a3859869d (patch)
tree2eb33b9f6813b8c8bfe25a787e564caab1c5cec6 /src/if_cscope.c
parenta546b21b24cb61dcff7bf4a1aa43cfbfec60ce40 (diff)
downloadvim-git-6f72e90dd843a7342395b31f31c2073a3859869d.tar.gz
patch 8.1.1991: still cannot build with eval but without cscopev8.1.1991
Problem: Still cannot build with eval but without cscope. Solution: Move f_cscope_connection() outside of #ifdef.
Diffstat (limited to 'src/if_cscope.c')
-rw-r--r--src/if_cscope.c58
1 files changed, 30 insertions, 28 deletions
diff --git a/src/if_cscope.c b/src/if_cscope.c
index 4f359ee55..aac613364 100644
--- a/src/if_cscope.c
+++ b/src/if_cscope.c
@@ -432,33 +432,6 @@ cs_connection(int num, char_u *dbpath, char_u *ppath)
return FALSE;
}
-/*
- * "cscope_connection([{num} , {dbpath} [, {prepend}]])" function
- *
- * Checks the existence of a cscope connection.
- */
- void
-f_cscope_connection(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
-{
-#ifdef FEAT_CSCOPE
- int num = 0;
- char_u *dbpath = NULL;
- char_u *prepend = NULL;
- char_u buf[NUMBUFLEN];
-
- if (argvars[0].v_type != VAR_UNKNOWN
- && argvars[1].v_type != VAR_UNKNOWN)
- {
- num = (int)tv_get_number(&argvars[0]);
- dbpath = tv_get_string(&argvars[1]);
- if (argvars[2].v_type != VAR_UNKNOWN)
- prepend = tv_get_string_buf(&argvars[2], buf);
- }
-
- rettv->vval.v_number = cs_connection(num, dbpath, prepend);
-#endif
-}
-
#endif
@@ -2527,4 +2500,33 @@ cs_end(void)
#endif /* FEAT_CSCOPE */
-/* the end */
+#if defined(FEAT_EVAL) || defined(PROTO)
+
+/*
+ * "cscope_connection([{num} , {dbpath} [, {prepend}]])" function
+ *
+ * Checks the existence of a cscope connection.
+ */
+ void
+f_cscope_connection(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
+{
+# ifdef FEAT_CSCOPE
+ int num = 0;
+ char_u *dbpath = NULL;
+ char_u *prepend = NULL;
+ char_u buf[NUMBUFLEN];
+
+ if (argvars[0].v_type != VAR_UNKNOWN
+ && argvars[1].v_type != VAR_UNKNOWN)
+ {
+ num = (int)tv_get_number(&argvars[0]);
+ dbpath = tv_get_string(&argvars[1]);
+ if (argvars[2].v_type != VAR_UNKNOWN)
+ prepend = tv_get_string_buf(&argvars[2], buf);
+ }
+
+ rettv->vval.v_number = cs_connection(num, dbpath, prepend);
+# endif
+}
+
+#endif // FEAT_EVAL