# endif
;
-EXTERN int did_repeated_msg INIT(= 0);
-# define REPEATED_MSG_LOOKING 1
-# define REPEATED_MSG_SAFESTATE 2
-
-// This flag is set when outputting a terminal control code and reset in
-// out_flush() when characters have been written.
-EXTERN int ch_log_output INIT(= FALSE);
-
// Whether a redraw is needed for appending a line to a buffer.
EXTERN int channel_need_redraw INIT(= FALSE);
-#define FOR_ALL_CHANNELS(ch) \
+# define FOR_ALL_CHANNELS(ch) \
for ((ch) = first_channel; (ch) != NULL; (ch) = (ch)->ch_next)
-#define FOR_ALL_JOBS(job) \
+# define FOR_ALL_JOBS(job) \
for ((job) = first_job; (job) != NULL; (job) = (job)->jv_next)
#endif
+#ifdef FEAT_EVAL
+// This flag is set when outputting a terminal control code and reset in
+// out_flush() when characters have been written.
+EXTERN int ch_log_output INIT(= FALSE);
+
+EXTERN int did_repeated_msg INIT(= 0);
+# define REPEATED_MSG_LOOKING 1
+# define REPEATED_MSG_SAFESTATE 2
+#endif
+
#if defined(FEAT_DIFF)
#define FOR_ALL_DIFFBLOCKS_IN_TAB(tp, dp) \
for ((dp) = (tp)->tp_first_diff; (dp) != NULL; (dp) = (dp)->df_next)
}
static void
-ch_log_lead(const char *what, channel_T *ch, ch_part_T part)
+ch_log_lead(const char *what, channel_T *ch UNUSED, ch_part_T part UNUSED)
{
if (log_fd == NULL)
return;
# ifdef FEAT_JOB_CHANNEL
# include "job.pro"
# include "channel.pro"
+# endif
+# ifdef FEAT_EVAL
// Not generated automatically so that we can add an extra attribute.
void ch_log(channel_T *ch, const char *fmt, ...) ATTRIBUTE_FORMAT_PRINTF(2, 3);
void ch_error(channel_T *ch, const char *fmt, ...) ATTRIBUTE_FORMAT_PRINTF(2, 3);
-
# endif
# if defined(FEAT_GUI) || defined(FEAT_JOB_CHANNEL)
return (args[idx].v_type == VAR_UNKNOWN
|| check_for_job_arg(args, idx) != FAIL) ? OK : FAIL;
}
+#else
+/*
+ * Give an error and return FAIL unless "args[idx]" is an optional channel or a
+ * job. Used without the +channel feature, thus only VAR_UNKNOWN is accepted.
+ */
+ int
+check_for_opt_chan_or_job_arg(typval_T *args, int idx)
+{
+ return args[idx].v_type == VAR_UNKNOWN ? OK : FAIL;
+}
#endif
/*