diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-11-30 20:20:56 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-11-30 20:20:56 +0000 |
commit | 3b8c7083b265c35861a7f96b01c079471ff45152 (patch) | |
tree | 71d5b80407f912d39de8532da6f6d817bc2e8d11 | |
parent | 4c5678ff0c376661d4a8183a5a074a1203413b9d (diff) | |
download | vim-git-3b8c7083b265c35861a7f96b01c079471ff45152.tar.gz |
patch 9.0.0978: build errors without the +channel featurev9.0.0978
Problem: Build errors without the +channel feature. (John Marriott)
Solution: Adjust #ifdefs.
-rw-r--r-- | src/globals.h | 22 | ||||
-rw-r--r-- | src/logfile.c | 2 | ||||
-rw-r--r-- | src/message.c | 2 | ||||
-rw-r--r-- | src/proto.h | 3 | ||||
-rw-r--r-- | src/typval.c | 10 | ||||
-rw-r--r-- | src/version.c | 2 |
6 files changed, 28 insertions, 13 deletions
diff --git a/src/globals.h b/src/globals.h index 0cc7c9bc4..8fb4340b1 100644 --- a/src/globals.h +++ b/src/globals.h @@ -1998,23 +1998,25 @@ EXTERN char *ch_part_names[] # 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) diff --git a/src/logfile.c b/src/logfile.c index 3ab2c0f39..6c159b078 100644 --- a/src/logfile.c +++ b/src/logfile.c @@ -75,7 +75,7 @@ ch_log_active(void) } 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; diff --git a/src/message.c b/src/message.c index a2fc008c2..591691f3f 100644 --- a/src/message.c +++ b/src/message.c @@ -37,7 +37,7 @@ static char_u *confirm_msg = NULL; // ":confirm" message static char_u *confirm_msg_tail; // tail of confirm_msg static void display_confirm_msg(void); #endif -#ifdef FEAT_JOB_CHANNEL +#ifdef FEAT_EVAL static int emsg_to_channel_log = FALSE; #endif diff --git a/src/proto.h b/src/proto.h index 4c7f8c9da..9d1e1349d 100644 --- a/src/proto.h +++ b/src/proto.h @@ -263,11 +263,12 @@ void mbyte_im_set_active(int active_arg); # 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) diff --git a/src/typval.c b/src/typval.c index a445bf8e9..b1a006046 100644 --- a/src/typval.c +++ b/src/typval.c @@ -619,6 +619,16 @@ check_for_opt_job_arg(typval_T *args, int idx) 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 /* diff --git a/src/version.c b/src/version.c index 528b804c4..537f6aa35 100644 --- a/src/version.c +++ b/src/version.c @@ -696,6 +696,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 978, +/**/ 977, /**/ 976, |