]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 7.4.1343 v7.4.1343
authorBram Moolenaar <Bram@vim.org>
Wed, 17 Feb 2016 09:05:42 +0000 (10:05 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 17 Feb 2016 09:05:42 +0000 (10:05 +0100)
Problem:    Can't compile with +job but without +channel. (Andrei Olsen)
Solution:   Move get_job_options up and adjust #ifdef.

src/eval.c
src/version.c

index 963d9db672567a54cd22154b9311b774e40f791b..efabc08ea75b473e582889e7af73524bc9040999 100644 (file)
@@ -9850,6 +9850,68 @@ f_ceil(typval_T *argvars, typval_T *rettv)
 }
 #endif
 
+#if defined(FEAT_CHANNEL) || defined(FEAT_JOB)
+/*
+ * Get a callback from "arg".  It can be a Funcref or a function name.
+ * When "arg" is zero return an empty string.
+ * Return NULL for an invalid argument.
+ */
+    static char_u *
+get_callback(typval_T *arg)
+{
+    if (arg->v_type == VAR_FUNC || arg->v_type == VAR_STRING)
+       return arg->vval.v_string;
+    if (arg->v_type == VAR_NUMBER && arg->vval.v_number == 0)
+       return (char_u *)"";
+    EMSG(_("E999: Invalid callback argument"));
+    return NULL;
+}
+
+/*
+ * Get the option entries from "dict", and parse them.
+ * If an option value is invalid return FAIL.
+ */
+    static int
+get_job_options(dict_T *dict, jobopt_T *opt)
+{
+    dictitem_T *item;
+    char_u     *mode;
+
+    if (dict == NULL)
+       return OK;
+
+    if ((item = dict_find(dict, (char_u *)"mode", -1)) != NULL)
+    {
+       mode = get_tv_string(&item->di_tv);
+       if (STRCMP(mode, "nl") == 0)
+           opt->jo_mode = MODE_NL;
+       else if (STRCMP(mode, "raw") == 0)
+           opt->jo_mode = MODE_RAW;
+       else if (STRCMP(mode, "js") == 0)
+           opt->jo_mode = MODE_JS;
+       else if (STRCMP(mode, "json") == 0)
+           opt->jo_mode = MODE_JSON;
+       else
+       {
+           EMSG2(_(e_invarg2), mode);
+           return FAIL;
+       }
+    }
+
+    if ((item = dict_find(dict, (char_u *)"callback", -1)) != NULL)
+    {
+       opt->jo_callback = get_callback(&item->di_tv);
+       if (opt->jo_callback == NULL)
+       {
+           EMSG2(_(e_invarg2), "callback");
+           return FAIL;
+       }
+    }
+
+    return OK;
+}
+#endif
+
 #ifdef FEAT_CHANNEL
 /*
  * Get the channel from the argument.
@@ -9887,22 +9949,6 @@ f_ch_close(typval_T *argvars, typval_T *rettv UNUSED)
        channel_close(channel);
 }
 
-/*
- * Get a callback from "arg".  It can be a Funcref or a function name.
- * When "arg" is zero return an empty string.
- * Return NULL for an invalid argument.
- */
-    static char_u *
-get_callback(typval_T *arg)
-{
-    if (arg->v_type == VAR_FUNC || arg->v_type == VAR_STRING)
-       return arg->vval.v_string;
-    if (arg->v_type == VAR_NUMBER && arg->vval.v_number == 0)
-       return (char_u *)"";
-    EMSG(_("E999: Invalid callback argument"));
-    return NULL;
-}
-
 /*
  * "ch_logfile()" function
  */
@@ -9929,50 +9975,6 @@ f_ch_logfile(typval_T *argvars, typval_T *rettv UNUSED)
     ch_logfile(file);
 }
 
-/*
- * Get the option entries from "dict", and parse them.
- * If an option value is invalid return FAIL.
- */
-    static int
-get_job_options(dict_T *dict, jobopt_T *opt)
-{
-    dictitem_T *item;
-    char_u     *mode;
-
-    if (dict == NULL)
-       return OK;
-
-    if ((item = dict_find(dict, (char_u *)"mode", -1)) != NULL)
-    {
-       mode = get_tv_string(&item->di_tv);
-       if (STRCMP(mode, "nl") == 0)
-           opt->jo_mode = MODE_NL;
-       else if (STRCMP(mode, "raw") == 0)
-           opt->jo_mode = MODE_RAW;
-       else if (STRCMP(mode, "js") == 0)
-           opt->jo_mode = MODE_JS;
-       else if (STRCMP(mode, "json") == 0)
-           opt->jo_mode = MODE_JSON;
-       else
-       {
-           EMSG2(_(e_invarg2), mode);
-           return FAIL;
-       }
-    }
-
-    if ((item = dict_find(dict, (char_u *)"callback", -1)) != NULL)
-    {
-       opt->jo_callback = get_callback(&item->di_tv);
-       if (opt->jo_callback == NULL)
-       {
-           EMSG2(_(e_invarg2), "callback");
-           return FAIL;
-       }
-    }
-
-    return OK;
-}
-
 /*
  * "ch_open()" function
  */
index e77457b93d608e89c724dc083f5185390009889f..4f59a610f70b65d7610902e736b0e16fb11797a2 100644 (file)
@@ -747,6 +747,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1343,
 /**/
     1342,
 /**/