From: Andre Noll Date: Tue, 28 Sep 2021 20:05:45 +0000 (+0200) Subject: play: Avoid gcc warning when compiling without readline. X-Git-Tag: v0.6.4~10 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=43614711df496ca48e368e6e74c9d2abb264ce5d;p=paraslash.git play: Avoid gcc warning when compiling without readline. The EXPORT_PLAY_CMD_HANDLER() macro is only used when READLINE support is enabled, which leads to play.c:112: warning: macro "EXPORT_PLAY_CMD_HANDLER" is not used [-Wunused-macros] Define the macro only when HAVE_READLINE is defined by moving down the definition to the first user, com_quit(). --- diff --git a/play.c b/play.c index 7369c33f..ffdc8555 100644 --- a/play.c +++ b/play.c @@ -109,10 +109,6 @@ typedef int (*play_cmd_handler_t)(struct lls_parse_result *lpr); struct play_command_info { play_cmd_handler_t handler; }; -#define EXPORT_PLAY_CMD_HANDLER(_cmd) \ - const struct play_command_info lsg_play_cmd_com_ ## _cmd ## _user_data = { \ - .handler = com_ ## _cmd \ - }; static int loglevel = LL_WARNING; @@ -713,6 +709,11 @@ static void detach_stdout(void) btr_remove_node(&pt->btrn); } +#define EXPORT_PLAY_CMD_HANDLER(_cmd) \ + const struct play_command_info lsg_play_cmd_com_ ## _cmd ## _user_data = { \ + .handler = com_ ## _cmd \ + }; + static int com_quit(__a_unused struct lls_parse_result *lpr) { pt->rq = CRT_TERM_RQ;