summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 911670a)
raw | patch | inline | side by side (parent: 911670a)
author | Max Kellermann <max.kellermann@gmail.com> | |
Sun, 19 Mar 2017 09:53:49 +0000 (10:53 +0100) | ||
committer | Max Kellermann <max.kellermann@gmail.com> | |
Sun, 19 Mar 2017 09:53:49 +0000 (10:53 +0100) |
src/lirc.h | patch | blob | history | |
src/main.c | patch | blob | history |
diff --git a/src/lirc.h b/src/lirc.h
index fa5f3b17958797e577712516510c6aa43f769cfc..551879b344bd65c0756520a8ec41fbee80b45de7 100644 (file)
--- a/src/lirc.h
+++ b/src/lirc.h
#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 27a3a603b0f29871a5644cfc98c26dd290045a96..6de16e54bed8078f7b6f37b17ecc230dfd922cd3 100644 (file)
--- a/src/main.c
+++ b/src/main.c
#include "strfsong.h"
#include "i18n.h"
#include "player_command.h"
+#include "lirc.h"
#ifndef NCMPC_MINI
#include "conf.h"
#include "lyrics.h"
#endif
-#ifdef ENABLE_LIRC
-#include "lirc.h"
-#endif
-
#include <mpd/client.h>
#include <stdlib.h>
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) &&
close(sigwinch_pipes[0]);
close(sigwinch_pipes[1]);
-#ifdef ENABLE_LIRC
ncmpc_lirc_deinit();
-#endif
screen_exit();
#ifndef NCMPC_MINI