From 8736e490253e08ed36ddeed8d572a39a450a88b4 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 6 Oct 2008 16:03:24 +0200 Subject: include ncursesw/ncurses.h if available When compiling with libncursesw, include instead of (if available). --- src/colors.h | 4 ++++ src/command.h | 1 - src/list_window.h | 7 ++++++- src/ncu.c | 4 ++++ src/screen.h | 7 ++++++- src/screen_artist.c | 1 - src/screen_file.c | 1 - src/screen_help.c | 1 - src/screen_keydef.c | 1 - src/screen_list.h | 4 ++++ src/screen_lyrics.c | 1 - src/screen_play.c | 1 - src/screen_utils.h | 5 +++++ src/wreadln.h | 7 +++++++ 14 files changed, 36 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/colors.h b/src/colors.h index 051aa9e26..dec3ecd28 100644 --- a/src/colors.h +++ b/src/colors.h @@ -3,7 +3,11 @@ #include "config.h" +#ifdef HAVE_NCURSESW_NCURSES_H +#include +#else #include +#endif enum color { COLOR_TITLE = 1, diff --git a/src/command.h b/src/command.h index 63d83b0a4..b48bf80f6 100644 --- a/src/command.h +++ b/src/command.h @@ -3,7 +3,6 @@ #include #include -#include #define MAX_COMMAND_KEYS 3 diff --git a/src/list_window.h b/src/list_window.h index 1d93a363e..11c4cddab 100644 --- a/src/list_window.h +++ b/src/list_window.h @@ -4,9 +4,14 @@ #include "../config.h" #include "command.h" -#include #include +#ifdef HAVE_NCURSESW_NCURSES_H +#include +#else +#include +#endif + #define LW_HIDE_CURSOR 0x01 typedef const char *(*list_window_callback_fn_t)(unsigned index, diff --git a/src/ncu.c b/src/ncu.c index 1ade90b40..c31f97d6b 100644 --- a/src/ncu.c +++ b/src/ncu.c @@ -26,7 +26,11 @@ #include "options.h" #endif +#ifdef HAVE_NCURSESW_NCURSES_H +#include +#else #include +#endif void ncu_init(void) diff --git a/src/screen.h b/src/screen.h index ef7940a31..404d0a8d5 100644 --- a/src/screen.h +++ b/src/screen.h @@ -5,9 +5,14 @@ #include "mpdclient.h" #include "command.h" -#include #include +#ifdef HAVE_NCURSESW_NCURSES_H +#include +#else +#include +#endif + #define IS_PLAYING(s) (s==MPD_STATUS_STATE_PLAY) #define IS_PAUSED(s) (s==MPD_STATUS_STATE_PAUSE) #define IS_STOPPED(s) (!(IS_PLAYING(s) | IS_PAUSED(s))) diff --git a/src/screen_artist.c b/src/screen_artist.c index 846902e0a..5fec3c04c 100644 --- a/src/screen_artist.c +++ b/src/screen_artist.c @@ -32,7 +32,6 @@ #include #include #include -#include #define BUFSIZE 1024 diff --git a/src/screen_file.c b/src/screen_file.c index bef155f59..b14b3b104 100644 --- a/src/screen_file.c +++ b/src/screen_file.c @@ -32,7 +32,6 @@ #include #include #include -#include static struct screen_browser browser; diff --git a/src/screen_help.c b/src/screen_help.c index 3b66403d7..1f0043c09 100644 --- a/src/screen_help.c +++ b/src/screen_help.c @@ -27,7 +27,6 @@ #include #include #include -#include typedef struct { signed char highlight; diff --git a/src/screen_keydef.c b/src/screen_keydef.c index 86faabaf4..4e42b386f 100644 --- a/src/screen_keydef.c +++ b/src/screen_keydef.c @@ -29,7 +29,6 @@ #include #include #include -#include #define STATIC_ITEMS 0 #define STATIC_SUB_ITEMS 1 diff --git a/src/screen_list.h b/src/screen_list.h index 27c034676..e208a8bfe 100644 --- a/src/screen_list.h +++ b/src/screen_list.h @@ -22,7 +22,11 @@ #include "config.h" +#ifdef HAVE_NCURSESW_NCURSES_H +#include +#else #include +#endif extern const struct screen_functions screen_playlist; extern const struct screen_functions screen_browse; diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c index 2a8e10b67..6d9c6e4af 100644 --- a/src/screen_lyrics.c +++ b/src/screen_lyrics.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include diff --git a/src/screen_play.c b/src/screen_play.c index 37705c559..90b06aa0e 100644 --- a/src/screen_play.c +++ b/src/screen_play.c @@ -36,7 +36,6 @@ #include #include #include -#include #define MAX_SONG_LENGTH 512 diff --git a/src/screen_utils.h b/src/screen_utils.h index a550f1742..335faceb2 100644 --- a/src/screen_utils.h +++ b/src/screen_utils.h @@ -1,10 +1,15 @@ #ifndef SCREEN_UTILS_H #define SCREEN_UTILS_H +#include "config.h" #include "list_window.h" #include "command.h" +#ifdef HAVE_NCURSESW_NCURSES_H +#include +#else #include +#endif struct mpdclient; diff --git a/src/wreadln.h b/src/wreadln.h index e1efe1c50..e1ac67318 100644 --- a/src/wreadln.h +++ b/src/wreadln.h @@ -1,8 +1,15 @@ #ifndef WREADLN_H #define WREADLN_H +#include "config.h" + #include + +#ifdef HAVE_NCURSESW_NCURSES_H +#include +#else #include +#endif /* completion callback data */ extern void *wrln_completion_callback_data; -- cgit v1.2.3