aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source/flutil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'externals/grill/flext/source/flutil.cpp')
-rw-r--r--externals/grill/flext/source/flutil.cpp32
1 files changed, 9 insertions, 23 deletions
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 <string.h>
-#ifdef NT
+#if FLEXT_OS == FLEXT_OS_WIN
#include <windows.h>
-#endif
-
-#ifdef MAXMSP
+#elif FLEXT_OS == FLEXT_OS_LINUX || FLEXT_OS == FLEXT_OS_IRIX || defined(__GNUC__)
+#include <unistd.h>
+#elif FLEXT_OS == FLEXT_OS_MACOS
#include <Timer.h>
#include <Threads.h>
#endif
-#ifdef unix
-#include <unistd.h>
-#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
}