diff --git a/configure.in b/configure.in index 500ec0da..219b2c30 100644 --- a/configure.in +++ b/configure.in @@ -19,6 +19,17 @@ if test "$clock" = "yes"; then AC_DEFINE([ENABLE_CLOCK], [1], [enables clock screen]) fi +dnl ==================================== +dnl = checking for win32 related stuff = +dnl ==================================== +AC_CHECK_LIB(ws2_32, _head_libws2_32_a, LDFLAGS="$LDFLAGS -lws2_32", ) +AC_CHECK_LIB(regex, regcomp, LDFLAGS="$LDFLAGS -lregex", ) + +dnl ================================ +dnl = checking for various headers = +dnl ================================ +AC_CHECK_HEADERS([dirent.h regex.h], , AC_MSG_ERROR(vital headers missing)) + dnl ====================== dnl = checking for iconv = dnl ====================== @@ -51,7 +62,7 @@ else AC_DEFINE([USE_PDCURSES], [1], [enables pdcurses support]) fi AC_PATH_PROG(CURSES_CONFIG, $curses_config_bin) -if test "$CURSES_CONFIG" != "" ; then +if test "$pdcurses" = "XCurses" && test "$CURSES_CONFIG" != "" ; then CPPFLAGS="$CPPFLAGS `$CURSES_CONFIG --cflags`" LDFLAGS="$LDFLAGS `$CURSES_CONFIG --libs`" AC_CHECK_LIB($curses_lib, initscr, , AC_MSG_ERROR([$curses_lib library is required])) diff --git a/src/info.cpp b/src/info.cpp index 963a1f92..e4820386 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -22,7 +22,11 @@ #ifdef HAVE_CURL_CURL_H # include -# include +# ifdef WIN32 +# include +# else +# include +# endif // WIN32 # include # include "curl/curl.h" # include "helpers.h" @@ -167,7 +171,11 @@ void *Info::PrepareArtist(void *ptr) EscapeUnallowedChars(filename); const string fullpath = Folder + "/" + filename; - mkdir(Folder.c_str(), 0755); + mkdir(Folder.c_str() +# ifndef WIN32 + , 0755 +# endif // !WIN32 + ); string result; std::ifstream input(fullpath.c_str()); diff --git a/src/lyrics.cpp b/src/lyrics.cpp index 9c6f8064..5cea972d 100644 --- a/src/lyrics.cpp +++ b/src/lyrics.cpp @@ -19,7 +19,11 @@ ***************************************************************************/ #include -#include +#ifdef WIN32 +# include +#else +# include +#endif // WIN32 #include #include "lyrics.h" @@ -166,7 +170,11 @@ void *Lyrics::Get(void *song) EscapeUnallowedChars(filename); Filename = Folder + "/" + filename; - mkdir(Folder.c_str(), 0755); + mkdir(Folder.c_str() +# ifndef WIN32 + , 0755 +# endif // !WIN32 + ); std::ifstream input(Filename.c_str()); diff --git a/src/ncmpcpp.cpp b/src/ncmpcpp.cpp index 8e1b9259..9efd2023 100644 --- a/src/ncmpcpp.cpp +++ b/src/ncmpcpp.cpp @@ -180,10 +180,11 @@ int main(int argc, char *argv[]) string screen_title; timeval now, past; - // local variables end +# ifndef WIN32 signal(SIGPIPE, SIG_IGN); +# endif // !WIN32 gettimeofday(&now, 0); diff --git a/src/settings.cpp b/src/settings.cpp index 9eecd70d..a7708229 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -18,7 +18,11 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include +#ifdef WIN32 +# include +#else +# include +#endif // WIN32 #include #include "helpers.h" @@ -77,7 +81,11 @@ namespace void CreateConfigDir() { - mkdir(config_dir.c_str(), 0755); + mkdir(config_dir.c_str() +# ifndef WIN32 + , 0755 +# endif // !WIN32 + ); } void DefaultKeys(ncmpcpp_keys &keys) diff --git a/src/window.cpp b/src/window.cpp index a3278fb6..a9b3ef08 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -23,6 +23,11 @@ #include "window.h" +/// FIXME: dirty workaround. +#ifdef WIN32 +# define wcwidth(x) 1 +#endif // WIN32 + using namespace NCurses; using std::string; diff --git a/src/window.h b/src/window.h index 1cf0c9d2..d393f2a8 100644 --- a/src/window.h +++ b/src/window.h @@ -25,9 +25,9 @@ #include #endif -#ifdef USE_PDCURSES +#if !defined(WIN32) && defined(USE_PDCURSES) # define XCURSES -#endif +#endif // !WIND32 && USE_PDCURSES #include "curses.h"