Code

include ncursesw/ncurses.h if available
authorMax Kellermann <max@duempel.org>
Mon, 6 Oct 2008 14:03:24 +0000 (16:03 +0200)
committerMax Kellermann <max@duempel.org>
Mon, 6 Oct 2008 14:03:24 +0000 (16:03 +0200)
When compiling with libncursesw, include <ncursesw/ncurses.h> instead
of <ncurses.h> (if available).

15 files changed:
configure.ac
src/colors.h
src/command.h
src/list_window.h
src/ncu.c
src/screen.h
src/screen_artist.c
src/screen_file.c
src/screen_help.c
src/screen_keydef.c
src/screen_list.h
src/screen_lyrics.c
src/screen_play.c
src/screen_utils.h
src/wreadln.h

index 4aa392e5008a1674d4f80840934e947ca2b29269..51faeee3eff24328772d11bd202ca5dfc8fb5f99 100644 (file)
@@ -83,6 +83,11 @@ AC_CHECK_LIB([$ncurses],
             [LIBS="$LIBS -l$ncurses"], 
             [AC_MSG_ERROR($ncurses library is required)])
 
+if test "x$ncurses" = "xncursesw"; then
+    AC_CHECK_HEADER([ncursesw/ncurses.h],
+                    AC_DEFINE([HAVE_NCURSESW_NCURSES_H], [1], [ncursesw/ncurses.h]),
+                    ,)
+fi
 
 
 dnl Check for glib-2.4
index 051aa9e26b76b6e050aabaf270d1f2ba690b534d..dec3ecd28da5df481689c47ffbc65daef0e0c862 100644 (file)
@@ -3,7 +3,11 @@
 
 #include "config.h"
 
+#ifdef HAVE_NCURSESW_NCURSES_H
+#include <ncursesw/ncurses.h>
+#else
 #include <ncurses.h>
+#endif
 
 enum color {
        COLOR_TITLE = 1,
index 63d83b0a4b2a39c4f2719503960d4e6913862229..b48bf80f6b43584249a6e9644ba43849f5324917 100644 (file)
@@ -3,7 +3,6 @@
 
 #include <stddef.h>
 #include <stdio.h>
-#include <ncurses.h>
 
 #define MAX_COMMAND_KEYS 3
 
index 1d93a363ef8d2634c037ce98c8a46af01966af4b..11c4cddaba6d5dc3d04e4ec3d8d4b05fd81280fd 100644 (file)
@@ -4,9 +4,14 @@
 #include "../config.h"
 #include "command.h"
 
-#include <ncurses.h>
 #include <glib.h>
 
+#ifdef HAVE_NCURSESW_NCURSES_H
+#include <ncursesw/ncurses.h>
+#else
+#include <ncurses.h>
+#endif
+
 #define LW_HIDE_CURSOR    0x01
 
 typedef const char *(*list_window_callback_fn_t)(unsigned index,
index 1ade90b4078020f4a5be9db3f788a590c783be40..c31f97d6b4ed5abe2de0debe414564d174707100 100644 (file)
--- a/src/ncu.c
+++ b/src/ncu.c
 #include "options.h"
 #endif
 
+#ifdef HAVE_NCURSESW_NCURSES_H
+#include <ncursesw/ncurses.h>
+#else
 #include <ncurses.h>
+#endif
 
 void
 ncu_init(void)
index ef7940a31e45dfcda744f6d2633065b3c479d039..404d0a8d565ce49fed7142d4a56a35fac0d7f26f 100644 (file)
@@ -5,9 +5,14 @@
 #include "mpdclient.h"
 #include "command.h"
 
-#include <ncurses.h>
 #include <glib.h>
 
+#ifdef HAVE_NCURSESW_NCURSES_H
+#include <ncursesw/ncurses.h>
+#else
+#include <ncurses.h>
+#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)))
index 846902e0a4807d09cfcc0216be595887d359ec45..5fec3c04c980c178b2172e001694eb471dadb3ca 100644 (file)
@@ -32,7 +32,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <glib.h>
-#include <ncurses.h>
 
 #define BUFSIZE 1024
 
index bef155f5948e10669e9c728c56b54bc2c2efa979..b14b3b10495aac68bd14ad75792ffe45162f1bac 100644 (file)
@@ -32,7 +32,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <glib.h>
-#include <ncurses.h>
 
 static struct screen_browser browser;
 
index 3b66403d7c88202be2245ae69ed69e1781107e99..1f0043c094b719ba06deeb91ff95d52bf6770a0f 100644 (file)
@@ -27,7 +27,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <glib.h>
-#include <ncurses.h>
 
 typedef struct {
        signed char highlight;
index 86faabaf403da448279f67e8f994095571e12604..4e42b386f2975d5002dddfa603572876a480c554 100644 (file)
@@ -29,7 +29,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <glib.h>
-#include <ncurses.h>
 
 #define STATIC_ITEMS      0
 #define STATIC_SUB_ITEMS  1
index 27c034676d3c6742d2d0ee06f71ccf0f64d9c0ed..e208a8bfec9d946cdf14f8e807d5599da901ab40 100644 (file)
 
 #include "config.h"
 
+#ifdef HAVE_NCURSESW_NCURSES_H
+#include <ncursesw/ncurses.h>
+#else
 #include <ncurses.h>
+#endif
 
 extern const struct screen_functions screen_playlist;
 extern const struct screen_functions screen_browse;
index 2a8e10b67fad0f6bc4c180994bdc37d17492c006..6d9c6e4af03ab96a700c0dc647f9d8ed0d114423 100644 (file)
@@ -33,7 +33,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <glib.h>
-#include <ncurses.h>
 #include <unistd.h>
 #include <stdio.h>
 
index 37705c559d4a8800df1903d575b93b4c2e19200a..90b06aa0eb730d3ef2ee8749a681e7e6dbd05db5 100644 (file)
@@ -36,7 +36,6 @@
 #include <string.h>
 #include <time.h>
 #include <glib.h>
-#include <ncurses.h>
 
 #define MAX_SONG_LENGTH 512
 
index a550f17428301d6864bcd6da274ff3ebbe9fbd0f..335faceb2b40b0183b6e0dd6e45245deff45a7cb 100644 (file)
@@ -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 <ncursesw/ncurses.h>
+#else
 #include <ncurses.h>
+#endif
 
 struct mpdclient;
 
index e1efe1c501600e7dd0092c3870808b786c27bab5..e1ac67318cde15e724ba51ec94867c87f4d1e47d 100644 (file)
@@ -1,8 +1,15 @@
 #ifndef WREADLN_H
 #define WREADLN_H
 
+#include "config.h"
+
 #include <glib.h>
+
+#ifdef HAVE_NCURSESW_NCURSES_H
+#include <ncursesw/ncurses.h>
+#else
 #include <ncurses.h>
+#endif
 
 /* completion callback data */
 extern void *wrln_completion_callback_data;