diff options
Diffstat (limited to 'externals/grill/flext/source')
-rw-r--r-- | externals/grill/flext/source/flbase.h | 4 | ||||
-rw-r--r-- | externals/grill/flext/source/flclass.h | 16 | ||||
-rwxr-xr-x | externals/grill/flext/source/flcwmax-x-thr.h | 30 | ||||
-rwxr-xr-x | externals/grill/flext/source/flcwmax-x.h (renamed from externals/grill/flext/source/flcwmax-thr.h) | 9 | ||||
-rw-r--r-- | externals/grill/flext/source/flcwmax.h | 32 | ||||
-rw-r--r-- | externals/grill/flext/source/flext.cpp | 2 | ||||
-rw-r--r-- | externals/grill/flext/source/flext.h | 7 | ||||
-rw-r--r-- | externals/grill/flext/source/flstdc.h | 4 | ||||
-rw-r--r-- | externals/grill/flext/source/flsupport.h | 3 |
9 files changed, 79 insertions, 28 deletions
diff --git a/externals/grill/flext/source/flbase.h b/externals/grill/flext/source/flbase.h index 21f96aaf..cf973a41 100644 --- a/externals/grill/flext/source/flbase.h +++ b/externals/grill/flext/source/flbase.h @@ -20,10 +20,6 @@ WARRANTIES, see the file, "license.txt," in this distribution. #include "flstdc.h" #include "flsupport.h" -#ifdef FLEXT_THREADS -#include <pthread.h> -#endif - class flext_obj; // ---------------------------------------------------------------------------- diff --git a/externals/grill/flext/source/flclass.h b/externals/grill/flext/source/flclass.h index f9b3deec..8c14e6b8 100644 --- a/externals/grill/flext/source/flclass.h +++ b/externals/grill/flext/source/flclass.h @@ -20,11 +20,6 @@ WARRANTIES, see the file, "license.txt," in this distribution. #include "flbase.h" #include "flsupport.h" -#ifdef FLEXT_THREADS -#include <pthread.h> -#include <sched.h> -#endif - #ifdef _MSC_VER #pragma warning(disable: 4786) #endif @@ -410,6 +405,10 @@ public: typedef pthread_t thrid_t; + /*! \brief Get current thread id + */ + static thrid_t GetThreadId(); + /*! \brief Increase/Decrease priority of a thread */ static bool ChangePriority(int dp,thrid_t thr = GetThreadId()); @@ -422,10 +421,6 @@ public: */ static bool SetPriority(int p,thrid_t thr = GetThreadId()); - /*! \brief Get current thread id - */ - static thrid_t GetThreadId(); - #endif // FLEXT_THREADS @@ -442,7 +437,8 @@ protected: /*! \brief Thread parameters \internal */ - class thr_params + class thr_params: + public flext { public: thr_params(flext_base *c,int n = 1); diff --git a/externals/grill/flext/source/flcwmax-x-thr.h b/externals/grill/flext/source/flcwmax-x-thr.h new file mode 100755 index 00000000..a5f105a2 --- /dev/null +++ b/externals/grill/flext/source/flcwmax-x-thr.h @@ -0,0 +1,30 @@ +/* + +flext - C++ layer for Max/MSP and pd (pure data) externals + +Copyright (c) 2001,2002 Thomas Grill (xovo@gmx.net) +For information on usage and redistribution, and for a DISCLAIMER OF ALL +WARRANTIES, see the file, "license.txt," in this distribution. + +*/ + +// This is the prefix file for CodeWarrior projects - threaded version + +#ifndef _FLEXT_CW_MAX_X_THR_H +#define _FLEXT_CW_MAX_X_THR_H + +#define FLEXT_THREADS +#define _POSIX_THREADS + +/* + old CodeWarrior version (<= 6) don't have sigset_t defined which + is needed for pthreads +*/ +#if defined(__MWERKS__) && (__MWERKS__ <= 0x6000) + typedef unsigned int sigset_t; + #define _CW_NOPRECOMP // no precompiled headers +#endif + +#include "flcwmax-x.h" + +#endif diff --git a/externals/grill/flext/source/flcwmax-thr.h b/externals/grill/flext/source/flcwmax-x.h index 1a9ecffb..1887c6e3 100755 --- a/externals/grill/flext/source/flcwmax-thr.h +++ b/externals/grill/flext/source/flcwmax-x.h @@ -8,12 +8,13 @@ WARRANTIES, see the file, "license.txt," in this distribution. */ -// This is the prefix file for CodeWarrior projects - threaded version +// This is the prefix file for CodeWarrior projects - OS X version -#ifndef _FLEXT_CW_MAX_THR_H -#define _FLEXT_CW_MAX_THR_H +#ifndef _FLEXT_CW_MAX_X_H +#define _FLEXT_CW_MAX_X_H -#define FLEXT_THREADS +#define TARGET_API_MAC_CARBON 1 +#define _POSIX_C_SOURCE #include "flcwmax.h" diff --git a/externals/grill/flext/source/flcwmax.h b/externals/grill/flext/source/flcwmax.h index 5ef0b298..184803ff 100644 --- a/externals/grill/flext/source/flcwmax.h +++ b/externals/grill/flext/source/flcwmax.h @@ -13,14 +13,36 @@ WARRANTIES, see the file, "license.txt," in this distribution. #ifndef _FLEXT_CW_MAX_H #define _FLEXT_CW_MAX_H -#include <MacHeaders.h> - -#define MAXMSP +#ifndef __MWERKS__ + #error "This header file is for CodeWarrior only." +#endif -#if !defined(__OPTIMIZE__) || __OPTIMIZE__ == 0 -#define _DEBUG +#ifndef _CW_NOPRECOMP + #include <MacHeaders.h> +#endif + +#if __option(sym) || !__option(opt_dead_code) + #define _DEBUG #endif +#ifdef MAXMSP + #pragma message("#define MAXMSP is deprecated, use #define FLEXT_SYS_MAX instead") +#else + #define FLEXT_SYS_MAX + // this is deprecated (but still necessary) + #define MAXMSP +#endif + +#if __POWERPC__ + #define FLEXT_PLATFORM_MAC +#elif __INTEL__ + #define FLEXT_PLATFORM_WIN + // this is necessary for Cycling headers when compiling for Windows + #define WIN_VERSION 1 +#else + #error "Target platform not supported." +#endif + /* #define _LOG */ #endif diff --git a/externals/grill/flext/source/flext.cpp b/externals/grill/flext/source/flext.cpp index 82ccdaba..85f3da6e 100644 --- a/externals/grill/flext/source/flext.cpp +++ b/externals/grill/flext/source/flext.cpp @@ -149,7 +149,7 @@ flext_base::~flext_base() shouldexit = true; for(int wi = 0; thrhead && wi < 100; ++wi) Sleep(0.01f); -#ifdef PD +#ifdef _POSIX_THREADS qmutex.Lock(); // Lock message queue tlmutex.Lock(); // timeout -> hard termination diff --git a/externals/grill/flext/source/flext.h b/externals/grill/flext/source/flext.h index 402a2a93..c1cd7597 100644 --- a/externals/grill/flext/source/flext.h +++ b/externals/grill/flext/source/flext.h @@ -31,6 +31,13 @@ WARRANTIES, see the file, "license.txt," in this distribution. //! @} + +#ifdef FLEXT_THREADS +#include <pthread.h> +#include <sched.h> +#endif + + // include all the flext interface definitions #include "fldefs.h" diff --git a/externals/grill/flext/source/flstdc.h b/externals/grill/flext/source/flstdc.h index f4e7ea48..4031dda1 100644 --- a/externals/grill/flext/source/flstdc.h +++ b/externals/grill/flext/source/flstdc.h @@ -115,11 +115,7 @@ typedef t_symbol *t_symptr; typedef t_symbol *t_symtype; typedef t_object *t_thing; -#ifdef MAC_VERSION -typedef void t_qelem; -#else typedef qelem t_qelem; -#endif typedef method t_method; typedef method t_newmethod; diff --git a/externals/grill/flext/source/flsupport.h b/externals/grill/flext/source/flsupport.h index 04d447ed..d8dce68d 100644 --- a/externals/grill/flext/source/flsupport.h +++ b/externals/grill/flext/source/flsupport.h @@ -172,6 +172,9 @@ public: // --- atom stuff ---------------------------------------- //! Set atom from another atom + static int GetType(const t_atom &a) { return a.a_type; } + + //! Set atom from another atom static void SetAtom(t_atom &a,const t_atom &b) { CopyAtom(&a,&b); } //! Check whether the atom is nothing |