From 0112dbebebb521254d2935fb4980a16bce97d32f Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Wed, 11 Aug 2004 04:04:25 +0000 Subject: "" svn path=/trunk/; revision=1937 --- externals/grill/flext/source/flbase.cpp | 9 +++++++-- externals/grill/flext/source/flmap.h | 5 +++-- externals/grill/flext/source/flstdc.h | 8 +++++--- externals/grill/flext/source/flsupport.cpp | 8 ++++++++ 4 files changed, 23 insertions(+), 7 deletions(-) (limited to 'externals/grill/flext/source') diff --git a/externals/grill/flext/source/flbase.cpp b/externals/grill/flext/source/flbase.cpp index 04bad89f..12e13fdf 100644 --- a/externals/grill/flext/source/flbase.cpp +++ b/externals/grill/flext/source/flbase.cpp @@ -2,7 +2,7 @@ flext - C++ layer for Max/MSP and pd (pure data) externals -Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2001-2004 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. @@ -135,7 +135,12 @@ bool flext_obj::GetParamSym(t_atom &dst,const t_symbol *sym,t_canvas *c) #if FLEXT_SYS == FLEXT_SYS_PD // this declaration is missing in m_pd.h (0.37-0 and -1) -extern "C" void canvas_getargs(int *argcp, t_atom **argvp); +// but it is there in 0.37-2 (but how to tell which micro-version?) +extern "C" +#ifdef _MSC_VER +__declspec(dllimport) +#endif +void canvas_getargs(int *argcp, t_atom **argvp); #endif diff --git a/externals/grill/flext/source/flmap.h b/externals/grill/flext/source/flmap.h index e93b5466..c20b5ade 100644 --- a/externals/grill/flext/source/flmap.h +++ b/externals/grill/flext/source/flmap.h @@ -48,9 +48,10 @@ public: iterator() {} #if defined(_MSC_VER) && (_MSC_VER < 0x1300) // with the MSVC6 STL implementation iterators can't be initialized... - iterator(AnyMap::iterator &it) { static_cast(*this) = it; } + iterator(AnyMap::iterator it) { static_cast(*this) = it; } #else - iterator(AnyMap::iterator &it): AnyMap::iterator(it) {} + // note: &it doesn't work for gcc (i don't know why it doesn't...) + iterator(AnyMap::iterator it): AnyMap::iterator(it) {} #endif inline K &key() const { return *(K *)&((*this)->first); } diff --git a/externals/grill/flext/source/flstdc.h b/externals/grill/flext/source/flstdc.h index 92ea3fe8..5f503f1f 100644 --- a/externals/grill/flext/source/flstdc.h +++ b/externals/grill/flext/source/flstdc.h @@ -126,10 +126,12 @@ typedef t_int t_flint; typedef t_symbol *t_symtype; typedef t_object *t_thing; -#if FLEXT_OS == FLEXT_OS_WIN -typedef void *t_qelem; // qelem not defined in Windows SDK -#else +// for the following to work for Max for OSX you should have the latest SDK +#if FLEXT_OS == FLEXT_OS_MAC && !defined(MAC_VERSION) +// Max for OS9 SDK typedef qelem t_qelem; +#else +typedef void *t_qelem; #endif typedef method t_method; diff --git a/externals/grill/flext/source/flsupport.cpp b/externals/grill/flext/source/flsupport.cpp index abec1994..8aa12fb0 100644 --- a/externals/grill/flext/source/flsupport.cpp +++ b/externals/grill/flext/source/flsupport.cpp @@ -161,6 +161,8 @@ void *flext_root::operator new(size_t bytes) #if FLEXT_SYS == FLEXT_SYS_JMAX blk = (char *)::fts_malloc(bytes); +#elif defined(FLEXT_USECMEM) + blk = (char *)::malloc(bytes); #else blk = (char *)::getbytes(bytes); #endif @@ -194,6 +196,8 @@ void flext_root::operator delete(void *blk) #if FLEXT_SYS == FLEXT_SYS_JMAX ::fts_free(ori); +#elif defined(FLEXT_USECMEM) + ::free(ori); #else ::freebytes(ori,bytes); #endif @@ -222,6 +226,8 @@ void *flext_root::NewAligned(size_t bytes,int bitalign) #if FLEXT_SYS == FLEXT_SYS_JMAX blk = (char *)::fts_malloc(bytes); +#elif defined(FLEXT_USECMEM) + blk = (char *)::malloc(bytes); #else blk = (char *)::getbytes(bytes); #endif @@ -256,6 +262,8 @@ void flext_root::FreeAligned(void *blk) #if FLEXT_SYS == FLEXT_SYS_JMAX ::fts_free(ori); +#elif defined(FLEXT_USECMEM) + ::free(ori); #else ::freebytes(ori,bytes); #endif -- cgit v1.2.1