From: Max Kellermann Date: Sun, 19 Mar 2017 09:53:49 +0000 (+0100) Subject: main: move "#ifdef ENABLE_LIRC" to lirc.h" X-Git-Tag: v0.26~39 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1e0ab55558bb51416281654f1ed26118053f7717;p=ncmpc.git main: move "#ifdef ENABLE_LIRC" to lirc.h" --- diff --git a/src/lirc.h b/src/lirc.h index fa5f3b1..551879b 100644 --- a/src/lirc.h +++ b/src/lirc.h @@ -20,10 +20,24 @@ #ifndef LIRC_H #define LIRC_H +#include "config.h" + +#ifdef ENABLE_LIRC + void ncmpc_lirc_init(void); void ncmpc_lirc_deinit(void); +#else + +static inline void +ncmpc_lirc_init(void) {} + +static inline void +ncmpc_lirc_deinit(void) {} + +#endif + #endif diff --git a/src/main.c b/src/main.c index 27a3a60..6de16e5 100644 --- a/src/main.c +++ b/src/main.c @@ -31,6 +31,7 @@ #include "strfsong.h" #include "i18n.h" #include "player_command.h" +#include "lirc.h" #ifndef NCMPC_MINI #include "conf.h" @@ -40,10 +41,6 @@ #include "lyrics.h" #endif -#ifdef ENABLE_LIRC -#include "lirc.h" -#endif - #include #include @@ -553,10 +550,8 @@ main(int argc, const char *argv[]) g_io_add_watch(keyboard_channel, G_IO_IN, keyboard_event, NULL); g_io_channel_unref(keyboard_channel); -#ifdef ENABLE_LIRC /* watch out for lirc input */ ncmpc_lirc_init(); -#endif #ifndef WIN32 if (!pipe(sigwinch_pipes) && @@ -602,9 +597,7 @@ main(int argc, const char *argv[]) close(sigwinch_pipes[0]); close(sigwinch_pipes[1]); -#ifdef ENABLE_LIRC ncmpc_lirc_deinit(); -#endif screen_exit(); #ifndef NCMPC_MINI