aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2011-08-01 15:43:53 +0000
committerIOhannes m zmölnig <zmoelnig@iem.at>2015-10-14 15:23:30 +0200
commitd2628954d9b7639382949d3b5e6a9bf138f54abc (patch)
tree0b43cd5884d45c820bdfe11f2e5b010cd2c89d1e
parent8d40d65f0688a8731edbf51b63f066917e27ac30 (diff)
got everything building under MinGW
svn path=/trunk/externals/unauthorized/; revision=15185
-rw-r--r--Makefile2
-rw-r--r--cooled~.c18
-rw-r--r--filterbank~.c7
-rw-r--r--probalizer.c7
-rw-r--r--sonogram~.c13
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 <windows.h>
+#endif
+
+#ifndef _MSC_VER
# include <unistd.h>
#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 <io.h>
-#else
+# include <io.h>
+# define random rand
+#endif
+
+#ifndef _MSC_VER /* only MSVC doesn't have unistd.h */
#include <unistd.h>
#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 <io.h>
-#else
+# include <io.h>
+# define random rand
+#endif
+
+#ifndef _MSC_VER /* only MSVC doesn't have unistd.h */
#include <unistd.h>
#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 <ctype.h>
#include <pthread.h>
-#ifdef UNIX
-#include <unistd.h>
+#include <math.h>
+
+#ifdef _WIN32
+# include <io.h>
+# define random rand
#endif
-#ifdef NT
-#define M_PI 3.14159265358979323846
+
+#ifndef _MSC_VER /* only MSVC doesn't have unistd.h */
+# include <unistd.h>
#endif
-#include <math.h>
#include "m_pd.h"
#include "m_imp.h"