make it compile under mingw32 --without-curl --without-taglib
ncmpcpp can be built for windows \o/ pdcurses and regex libraries are needed for this though.
This commit is contained in:
13
configure.in
13
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]))
|
||||
|
||||
12
src/info.cpp
12
src/info.cpp
@@ -22,7 +22,11 @@
|
||||
|
||||
#ifdef HAVE_CURL_CURL_H
|
||||
# include <fstream>
|
||||
# include <sys/stat.h>
|
||||
# ifdef WIN32
|
||||
# include <io.h>
|
||||
# else
|
||||
# include <sys/stat.h>
|
||||
# endif // WIN32
|
||||
# include <pthread.h>
|
||||
# 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());
|
||||
|
||||
@@ -19,7 +19,11 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include <cstring>
|
||||
#include <sys/stat.h>
|
||||
#ifdef WIN32
|
||||
# include <io.h>
|
||||
#else
|
||||
# include <sys/stat.h>
|
||||
#endif // WIN32
|
||||
#include <fstream>
|
||||
|
||||
#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());
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -18,7 +18,11 @@
|
||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <sys/stat.h>
|
||||
#ifdef WIN32
|
||||
# include <io.h>
|
||||
#else
|
||||
# include <sys/stat.h>
|
||||
#endif // WIN32
|
||||
#include <fstream>
|
||||
|
||||
#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)
|
||||
|
||||
@@ -23,6 +23,11 @@
|
||||
|
||||
#include "window.h"
|
||||
|
||||
/// FIXME: dirty workaround.
|
||||
#ifdef WIN32
|
||||
# define wcwidth(x) 1
|
||||
#endif // WIN32
|
||||
|
||||
using namespace NCurses;
|
||||
|
||||
using std::string;
|
||||
|
||||
@@ -25,9 +25,9 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef USE_PDCURSES
|
||||
#if !defined(WIN32) && defined(USE_PDCURSES)
|
||||
# define XCURSES
|
||||
#endif
|
||||
#endif // !WIND32 && USE_PDCURSES
|
||||
|
||||
#include "curses.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user