From 60ee6bb60b11bbfbccf56f335c9c6213e6daa79d Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Thu, 5 Dec 2002 05:36:32 +0000 Subject: "" svn path=/trunk/; revision=278 --- externals/grill/flext/source/flutil.cpp | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) (limited to 'externals/grill/flext/source/flutil.cpp') diff --git a/externals/grill/flext/source/flutil.cpp b/externals/grill/flext/source/flutil.cpp index 5307b820..2a65aaf6 100644 --- a/externals/grill/flext/source/flutil.cpp +++ b/externals/grill/flext/source/flutil.cpp @@ -15,34 +15,18 @@ WARRANTIES, see the file, "license.txt," in this distribution. #include "flext.h" #include -#ifdef NT +#if FLEXT_OS == FLEXT_OS_WIN #include -#endif - -#ifdef MAXMSP +#elif FLEXT_OS == FLEXT_OS_LINUX || FLEXT_OS == FLEXT_OS_IRIX || defined(__GNUC__) +#include +#elif FLEXT_OS == FLEXT_OS_MACOS #include #include #endif -#ifdef unix -#include -#endif - -t_atom *flext::CopyList(int argc,const t_atom *argv) -{ - int i; - t_atom *dst = new t_atom[argc]; - for(i = 0; i < argc; ++i) CopyAtom(dst+i,argv+i); - return dst; -} - void flext::CopyMem(void *dst,const void *src,int bytes) { -#ifdef macintosh - BlockMoveData(src,dst,bytes); -#else memcpy(dst,src,bytes); -#endif } void flext::ZeroMem(void *dst,int bytes) @@ -52,9 +36,11 @@ void flext::ZeroMem(void *dst,int bytes) void flext::Sleep(float s) { -#ifdef NT +#if FLEXT_OS == FLEXT_OS_WIN ::Sleep((long)(s*1000)); -#elif defined(MAXMSP) +#elif FLEXT_OS == FLEXT_OS_LINUX || FLEXT_OS == FLEXT_OS_IRIX || defined(__GNUC__) + usleep((long)(s*1000000)); +#elif FLEXT_OS == FLEXT_OS_MACOS UnsignedWide tick; Microseconds(&tick); double target = tick.hi*((double)(1L<<((sizeof tick.lo)*4))*(double)(1L<<((sizeof tick.lo)*4)))+tick.lo+s*1.e6; @@ -64,6 +50,6 @@ void flext::Sleep(float s) YieldToAnyThread(); // should we really yield? } #else - usleep((long)(s*1000000)); +#error #endif } -- cgit v1.2.1