mtytel / cursynth

GNU ncurses terminal synthesizer
http://gnu.org/software/cursynth
GNU General Public License v3.0
446 stars 64 forks source link

building on Windows #8

Open lm8 opened 10 years ago

lm8 commented 10 years ago

Tried building cursynth on Windows using MinGW and msys. It builds successfully, but it needed the following patches to do so. While either ncurses of pdcurses is available on both Linux, BSD and Windows platforms, Windows builds typically use pdcurses. I replaced the link to the ncurses library in src/Makefile with -lpdcurses and the patches switch from the ncurses header to the pdcurses header file on Windows. Might be nicer to give the user the option to pick ncurses or pdcurses instead of defaulting by platform. Also, on most systems mkdir takes to arguments, but on Windows, it just takes one. Windows streams are typically text instead of binary based unless specified as binary.

diff -Naurp src/cursynth-1.4/rtaudio/RtAudio.cpp tmp/cursynth-1.4/rtaudio/RtAudio.cpp --- src/cursynth-1.4/rtaudio/RtAudio.cpp 2014-01-21 21:31:39 -0500 +++ tmp/cursynth-1.4/rtaudio/RtAudio.cpp
@@ -3558,6 +3558,7 @@ static const char* getAsioErrorString( A

pragma comment( lib, "winmm.lib" ) // then, auto-link winmm.lib. Otherwise, it has to be added manually.

endif

+#include static inline DWORD dsPointerBetween( DWORD pointer, DWORD laterPointer, DWORD earlierPointer, DWORD bufferSize ) { if ( pointer > bufferSize ) pointer -= bufferSize; @@ -7130,6 +7131,9 @@ bool RtApiOss :: probeDeviceOpen( unsign

// Try to open the device. int fd; +#ifdef _WIN32

iyoko commented 10 years ago

Hey! Sorry I didn't respond for a while. I'll look this over and get back to you.