From d2628954d9b7639382949d3b5e6a9bf138f54abc Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 1 Aug 2011 15:43:53 +0000 Subject: got everything building under MinGW svn path=/trunk/externals/unauthorized/; revision=15185 --- Makefile | 2 +- cooled~.c | 18 +++++++++++++----- filterbank~.c | 7 +++++-- probalizer.c | 7 +++++-- sonogram~.c | 13 ++++++++----- 5 files changed, 32 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 195b350..feee5d5 100644 --- a/Makefile +++ b/Makefile @@ -197,7 +197,7 @@ ifeq (MINGW,$(findstring MINGW,$(UNAME))) OPT_CFLAGS = -O3 -funroll-loops -fomit-frame-pointer CFLAGS += -mms-bitfields LDFLAGS += -s -shared -Wl,--enable-auto-import - LIBS += -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin" -L"$(PD_PATH)/obj" -lpd -lwsock32 -lkernel32 -luser32 -lgdi32 + LIBS += -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin" -L"$(PD_PATH)/obj" -lpd -lwsock32 -lkernel32 -luser32 -lgdi32 -lpthreadGC2 STRIP = strip --strip-unneeded -R .note -R .comment DISTBINDIR=$(DISTDIR)-$(OS) endif diff --git a/cooled~.c b/cooled~.c index ed5b4b8..7e1886a 100644 --- a/cooled~.c +++ b/cooled~.c @@ -48,7 +48,10 @@ #ifdef _WIN32 # define M_PI 3.14159265358979323846 -#else +# include +#endif + +#ifndef _MSC_VER # include #endif @@ -58,9 +61,6 @@ static int guidebug=0; -static int ignorevisible=1; // ignore visible test - // because this seems to lead to bad refresh - // wait for a fix #define SYS_VGUI2(a,b) if (guidebug) \ post(a,b);\ @@ -332,8 +332,10 @@ static void *cooled_do_update_part(void *tdata) SYS_VGUI3(".x%x.c itemconfigure %xCOOLED -outline #000000\n", canvas, x); } +#ifndef _WIN32 post("cooled~ : child thread %d ended", (int)x->x_updatechild ); - x->x_updatechild = 0; + x->x_updatechild = NULL; +#endif return NULL; } @@ -343,11 +345,13 @@ static void cooled_update_part(t_cooled *x, t_glist *glist, int bstart, int bend pthread_attr_t update_child_attr; t_canvas *canvas=glist_getcanvas(x->x_glist); +#ifndef _WIN32 if ( x->x_updatechild != 0 ) { // post( "cooled~ : error : no update is possible for now" ); return; } +#endif x->x_updatestart = bstart; x->x_updateend = bend; if ( !keepframe ) @@ -1154,10 +1158,12 @@ static void cooled_resize(t_cooled *x, t_floatarg fnewsize ) post( "cooled~ : error : cannot resize while re-allocation" ); return; } +#ifndef _WIN32 if (x->x_updatechild > 0) { post( "cooled~ : can't resize now, an update is pending." ); return; } +#endif post( "cooled~ : reallocating tables" ); x->x_allocate = 1; x->x_play = 0; @@ -1342,7 +1348,9 @@ static void *cooled_new(t_symbol *s, int argc, t_atom *argv) /* graphic data */ x->x_selected = 0; x->x_zoom = 1; +#ifndef _WIN32 x->x_updatechild = 0; +#endif x->x_glist = (t_glist*)canvas_getcurrent(); // post( "cooled~ : new : readend=%d", x->x_readend ); cooled_readstart( x, 0); diff --git a/filterbank~.c b/filterbank~.c index 626db7d..b27909c 100644 --- a/filterbank~.c +++ b/filterbank~.c @@ -34,8 +34,11 @@ #include "filterbank~.h" #ifdef _WIN32 -#include -#else +# include +# define random rand +#endif + +#ifndef _MSC_VER /* only MSVC doesn't have unistd.h */ #include #endif diff --git a/probalizer.c b/probalizer.c index 073314e..e529d41 100644 --- a/probalizer.c +++ b/probalizer.c @@ -43,8 +43,11 @@ #include "probalizer.h" #ifdef _WIN32 -#include -#else +# include +# define random rand +#endif + +#ifndef _MSC_VER /* only MSVC doesn't have unistd.h */ #include #endif diff --git a/sonogram~.c b/sonogram~.c index 4085b34..18bf3c6 100644 --- a/sonogram~.c +++ b/sonogram~.c @@ -44,13 +44,16 @@ #endif #include #include -#ifdef UNIX -#include +#include + +#ifdef _WIN32 +# include +# define random rand #endif -#ifdef NT -#define M_PI 3.14159265358979323846 + +#ifndef _MSC_VER /* only MSVC doesn't have unistd.h */ +# include #endif -#include #include "m_pd.h" #include "m_imp.h" -- cgit v1.2.1