From e728a5bc3db296b4b67c2d3e5b56558c42c566a8 Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Mon, 21 Jun 2004 14:08:57 +0000 Subject: "" svn path=/trunk/; revision=1826 --- externals/grill/flext/source/flprefix.h | 484 ++++++++++++++++---------------- 1 file changed, 242 insertions(+), 242 deletions(-) (limited to 'externals/grill/flext/source/flprefix.h') diff --git a/externals/grill/flext/source/flprefix.h b/externals/grill/flext/source/flprefix.h index a61ec8d7..626ff70a 100755 --- a/externals/grill/flext/source/flprefix.h +++ b/externals/grill/flext/source/flprefix.h @@ -16,44 +16,44 @@ WARRANTIES, see the file, "license.txt," in this distribution. #define __FLEXT_PREFIX_H // --- definitions for FLEXT_SYS --------------------- -#define FLEXT_SYS_UNKNOWN 0 +#define FLEXT_SYS_UNKNOWN 0 #ifndef FLEXT_SYS_MAX - #define FLEXT_SYS_MAX 1 + #define FLEXT_SYS_MAX 1 #else - // already defined - #undef FLEXT_SYS_MAX - #define FLEXT_SYS_MAX 1 - #define FLEXT_SYS FLEXT_SYS_MAX + // already defined + #undef FLEXT_SYS_MAX + #define FLEXT_SYS_MAX 1 + #define FLEXT_SYS FLEXT_SYS_MAX #endif #ifndef FLEXT_SYS_PD - #define FLEXT_SYS_PD 2 + #define FLEXT_SYS_PD 2 #else - // already defined - #undef FLEXT_SYS_PD - #define FLEXT_SYS_PD 2 - #define FLEXT_SYS FLEXT_SYS_PD + // already defined + #undef FLEXT_SYS_PD + #define FLEXT_SYS_PD 2 + #define FLEXT_SYS FLEXT_SYS_PD #endif #ifndef FLEXT_SYS_JMAX - #define FLEXT_SYS_JMAX 3 + #define FLEXT_SYS_JMAX 3 #else - // already defined - #undef FLEXT_SYS_JMAX - #define FLEXT_SYS_JMAX 3 - #define FLEXT_SYS FLEXT_SYS_JMAX + // already defined + #undef FLEXT_SYS_JMAX + #define FLEXT_SYS_JMAX 3 + #define FLEXT_SYS FLEXT_SYS_JMAX #endif // --- definitions for FLEXT_OS ---------------------- -#define FLEXT_OS_UNKNOWN 0 -#define FLEXT_OS_WIN 1 -#define FLEXT_OS_MAC 2 -#define FLEXT_OS_LINUX 3 -#define FLEXT_OS_IRIX 4 +#define FLEXT_OS_UNKNOWN 0 +#define FLEXT_OS_WIN 1 +#define FLEXT_OS_MAC 2 +#define FLEXT_OS_LINUX 3 +#define FLEXT_OS_IRIX 4 // --- definitions for FLEXT_OS_API --------------------- -#define FLEXT_OSAPI_UNKNOWN 0 +#define FLEXT_OSAPI_UNKNOWN 0 #define FLEXT_OSAPI_UNIX_POSIX 1 @@ -62,36 +62,36 @@ WARRANTIES, see the file, "license.txt," in this distribution. #define FLEXT_OSAPI_MAC_MACH 4 #define FLEXT_OSAPI_WIN_NATIVE 5 // WIN32 Platform -#define FLEXT_OSAPI_WIN_POSIX 6 // POSIX API (e.g. cygwin) +#define FLEXT_OSAPI_WIN_POSIX 6 // POSIX API (e.g. cygwin) // --- definitions for FLEXT_CPU --------------------- -#define FLEXT_CPU_UNKNOWN 0 +#define FLEXT_CPU_UNKNOWN 0 #define FLEXT_CPU_INTEL 1 -#define FLEXT_CPU_PPC 2 -#define FLEXT_CPU_MIPS 3 -#define FLEXT_CPU_ALPHA 4 +#define FLEXT_CPU_PPC 2 +#define FLEXT_CPU_MIPS 3 +#define FLEXT_CPU_ALPHA 4 // --- definitions for FLEXT_THREADS ----------------- #define FLEXT_THR_POSIX 1 // pthreads -#define FLEXT_THR_WIN32 2 // Win32 native -#define FLEXT_THR_MP 3 // MacOS MPThreads +#define FLEXT_THR_WIN32 2 // Win32 native +#define FLEXT_THR_MP 3 // MacOS MPThreads // --------------------------------------------------- // support old definitions #ifndef FLEXT_SYS - #if defined(MAXMSP) - #define FLEXT_SYS FLEXT_SYS_MAX - // #undef MAXMSP - #elif defined(PD) - #define FLEXT_SYS FLEXT_SYS_PD - // #undef PD - // #undef NT - #endif + #if defined(MAXMSP) + #define FLEXT_SYS FLEXT_SYS_MAX + // #undef MAXMSP + #elif defined(PD) + #define FLEXT_SYS FLEXT_SYS_PD + // #undef PD + // #undef NT + #endif #endif #if defined(_DEBUG) && !defined(FLEXT_DEBUG) - #define FLEXT_DEBUG + #define FLEXT_DEBUG #endif // --------------------------------------------------- @@ -101,268 +101,268 @@ WARRANTIES, see the file, "license.txt," in this distribution. #elif FLEXT_SYS == FLEXT_SYS_PD #elif FLEXT_SYS == FLEXT_SYS_JMAX #else - #error "System must be defined by either FLEXT_SYS_MAX, FLEXT_SYS_PD or FLEXT_SYS_JMAX" + #error "System must be defined by either FLEXT_SYS_MAX, FLEXT_SYS_PD or FLEXT_SYS_JMAX" #endif // Definition of OS/CPU #if defined(_MSC_VER) || (defined(__ICC) && (FLEXT_OS == FLEXT_OS_WIN || defined(_WIN32))) - // Microsoft C++ + // Microsoft C++ // and Intel C++ (as guessed) - - #ifndef FLEXT_CPU - #if defined(_M_IX86) - #define FLEXT_CPU FLEXT_CPU_INTEL - #elif defined(_M_PPC) - #define FLEXT_CPU FLEXT_CPU_PPC - #elif defined(_M_MRX000) - #define FLEXT_CPU FLEXT_CPU_MIPS - #elif defined(_M_ALPHA) - #define FLEXT_CPU FLEXT_CPU_ALPHA - #else - #define FLEXT_CPU FLEXT_CPU_UNKNOWN - #endif - #endif - - #ifndef FLEXT_OS - #if defined(_WIN32) - #define FLEXT_OS FLEXT_OS_WIN - #define FLEXT_OSAPI FLEXT_OSAPI_WIN_NATIVE - #else - #define FLEXT_OS FLEXT_OS_UNKNOWN - #define FLEXT_OSAPI FLEXT_OSAPI_UNKNOWN - #endif - #endif + + #ifndef FLEXT_CPU + #if defined(_M_IX86) + #define FLEXT_CPU FLEXT_CPU_INTEL + #elif defined(_M_PPC) + #define FLEXT_CPU FLEXT_CPU_PPC + #elif defined(_M_MRX000) + #define FLEXT_CPU FLEXT_CPU_MIPS + #elif defined(_M_ALPHA) + #define FLEXT_CPU FLEXT_CPU_ALPHA + #else + #define FLEXT_CPU FLEXT_CPU_UNKNOWN + #endif + #endif + + #ifndef FLEXT_OS + #if defined(_WIN32) + #define FLEXT_OS FLEXT_OS_WIN + #define FLEXT_OSAPI FLEXT_OSAPI_WIN_NATIVE + #else + #define FLEXT_OS FLEXT_OS_UNKNOWN + #define FLEXT_OSAPI FLEXT_OSAPI_UNKNOWN + #endif + #endif #elif defined(__BORLANDC__) - // Borland C++ + // Borland C++ - #ifndef FLEXT_CPU - #define FLEXT_CPU FLEXT_CPU_INTEL - #endif - #ifndef FLEXT_OS - #define FLEXT_OS FLEXT_OS_WIN - #define FLEXT_OSAPI FLEXT_OSAPI_WIN_NATIVE - #else - #define FLEXT_OSAPI FLEXT_OSAPI_UNKNOWN - #endif + #ifndef FLEXT_CPU + #define FLEXT_CPU FLEXT_CPU_INTEL + #endif + #ifndef FLEXT_OS + #define FLEXT_OS FLEXT_OS_WIN + #define FLEXT_OSAPI FLEXT_OSAPI_WIN_NATIVE + #else + #define FLEXT_OSAPI FLEXT_OSAPI_UNKNOWN + #endif #elif defined(__MWERKS__) - // Metrowerks CodeWarrior - - #ifdef __MACH__ - // quick fix for OSX Mach-O - #define TARGET_CPU_PPC 1 - #define TARGET_OS_MAC 1 - #define TARGET_API_MAC_OSX 1 - #else - #ifndef __CONDITIONALMACROS__ - #include - #endif - #endif - - #ifndef FLEXT_CPU - #if TARGET_CPU_X86 - #define FLEXT_CPU FLEXT_CPU_INTEL - #elif TARGET_CPU_PPC - #define FLEXT_CPU FLEXT_CPU_PPC - #elif TARGET_CPU_MIPS - #define FLEXT_CPU FLEXT_CPU_MIPS - #elif TARGET_CPU_ALPHA - #define FLEXT_CPU FLEXT_CPU_ALPHA - #else - #define FLEXT_CPU FLEXT_CPU_UNKNOWN - #endif - #endif - - #ifndef FLEXT_OS - #if TARGET_OS_MAC - #define FLEXT_OS FLEXT_OS_MAC - #elif TARGET_OS_WIN32 - // assume Windows - #define FLEXT_OS FLEXT_OS_WIN - #else - #define FLEXT_OS FLEXT_OS_UNKNOWN - #endif - #endif - - #ifndef FLEXT_OSAPI - #if TARGET_API_MAC_MACH - // this is for Mach-O - // this has the precedence (MACH also supports Carbon, of course) - #define FLEXT_OSAPI FLEXT_OSAPI_MAC_MACH - #elif TARGET_API_MAC_CARBON - // this is for CFM - #define FLEXT_OSAPI FLEXT_OSAPI_MAC_CARBON - #else - #define FLEXT_OSAPI FLEXT_OSAPI_UNKNOWN - #endif - #endif - - // This is important for method and attribute callbacks - #pragma enumsalwaysint on - // This is important for everything - #pragma bool on + // Metrowerks CodeWarrior + + #ifdef __MACH__ + // quick fix for OSX Mach-O + #define TARGET_CPU_PPC 1 + #define TARGET_OS_MAC 1 + #define TARGET_API_MAC_OSX 1 + #else + #ifndef __CONDITIONALMACROS__ + #include + #endif + #endif + + #ifndef FLEXT_CPU + #if TARGET_CPU_X86 + #define FLEXT_CPU FLEXT_CPU_INTEL + #elif TARGET_CPU_PPC + #define FLEXT_CPU FLEXT_CPU_PPC + #elif TARGET_CPU_MIPS + #define FLEXT_CPU FLEXT_CPU_MIPS + #elif TARGET_CPU_ALPHA + #define FLEXT_CPU FLEXT_CPU_ALPHA + #else + #define FLEXT_CPU FLEXT_CPU_UNKNOWN + #endif + #endif + + #ifndef FLEXT_OS + #if TARGET_OS_MAC + #define FLEXT_OS FLEXT_OS_MAC + #elif TARGET_OS_WIN32 + // assume Windows + #define FLEXT_OS FLEXT_OS_WIN + #else + #define FLEXT_OS FLEXT_OS_UNKNOWN + #endif + #endif + + #ifndef FLEXT_OSAPI + #if TARGET_API_MAC_MACH + // this is for Mach-O + // this has the precedence (MACH also supports Carbon, of course) + #define FLEXT_OSAPI FLEXT_OSAPI_MAC_MACH + #elif TARGET_API_MAC_CARBON + // this is for CFM + #define FLEXT_OSAPI FLEXT_OSAPI_MAC_CARBON + #else + #define FLEXT_OSAPI FLEXT_OSAPI_UNKNOWN + #endif + #endif + + // This is important for method and attribute callbacks + #pragma enumsalwaysint on + // This is important for everything + #pragma bool on #elif defined(__GNUG__) || (defined(__ICC) && (FLEXT_OS == FLEXT_OS_LINUX || defined(linux) || defined(__linux__))) - // GNU C++ + // GNU C++ // and Intel (as suggested by Tim Blechmann) - #ifndef FLEXT_CPU - #if defined(_X86_) || defined(__i386__) || defined(__i586__) || defined(__i686__) - #define FLEXT_CPU FLEXT_CPU_INTEL - #elif defined(__POWERPC__) - #define FLEXT_CPU FLEXT_CPU_PPC - #elif defined(__MIPS__) - #define FLEXT_CPU FLEXT_CPU_MIPS - #else - #define FLEXT_CPU FLEXT_CPU_UNKNOWN - #endif - #endif - - #ifndef FLEXT_OS - #if defined(linux) || defined(__linux__) - #define FLEXT_OS FLEXT_OS_LINUX - #elif defined(__CYGWIN__) || defined(__CYGWIN32__) || defined(__MINGW32__) - #define FLEXT_OS FLEXT_OS_WIN - #elif defined(__APPLE__) && defined(__MACH__) - #define FLEXT_OS FLEXT_OS_MAC - // how about IRIX?? - #else - #define FLEXT_OS FLEXT_OS_UNKNOWN - #endif - #endif - - #ifndef FLEXT_OSAPI - #if FLEXT_OS == FLEXT_OS_MAC - #define FLEXT_OSAPI FLEXT_OSAPI_MAC_MACH - #elif FLEXT_OS == FLEXT_OS_WIN + #ifndef FLEXT_CPU + #if defined(_X86_) || defined(__i386__) || defined(__i586__) || defined(__i686__) + #define FLEXT_CPU FLEXT_CPU_INTEL + #elif defined(__POWERPC__) + #define FLEXT_CPU FLEXT_CPU_PPC + #elif defined(__MIPS__) + #define FLEXT_CPU FLEXT_CPU_MIPS + #else + #define FLEXT_CPU FLEXT_CPU_UNKNOWN + #endif + #endif + + #ifndef FLEXT_OS + #if defined(linux) || defined(__linux__) + #define FLEXT_OS FLEXT_OS_LINUX + #elif defined(__CYGWIN__) || defined(__CYGWIN32__) || defined(__MINGW32__) + #define FLEXT_OS FLEXT_OS_WIN + #elif defined(__APPLE__) && defined(__MACH__) + #define FLEXT_OS FLEXT_OS_MAC + // how about IRIX?? + #else + #define FLEXT_OS FLEXT_OS_UNKNOWN + #endif + #endif + + #ifndef FLEXT_OSAPI + #if FLEXT_OS == FLEXT_OS_MAC + #define FLEXT_OSAPI FLEXT_OSAPI_MAC_MACH + #elif FLEXT_OS == FLEXT_OS_WIN #if defined(__MINGW32__) - #define FLEXT_OSAPI FLEXT_OSAPI_WIN_NATIVE + #define FLEXT_OSAPI FLEXT_OSAPI_WIN_NATIVE #else - #define FLEXT_OSAPI FLEXT_OSAPI_WIN_POSIX + #define FLEXT_OSAPI FLEXT_OSAPI_WIN_POSIX #endif - #elif FLEXT_OS == FLEXT_OS_LINUX || FLEXT_OS == FLEXT_OS_IRIX - #define FLEXT_OSAPI FLEXT_OSAPI_UNIX_POSIX - #else - #define FLEXT_OSAPI FLEXT_OSAPI_UNKNOWN - #endif - #endif + #elif FLEXT_OS == FLEXT_OS_LINUX || FLEXT_OS == FLEXT_OS_IRIX + #define FLEXT_OSAPI FLEXT_OSAPI_UNIX_POSIX + #else + #define FLEXT_OSAPI FLEXT_OSAPI_UNKNOWN + #endif + #endif #elif defined(__MRC__) && defined(MPW_CPLUS) - // Apple MPW MrCpp - - #if __MRC__ < 0x500 - #error Apple MPW MrCpp v.5.0.0 or later compiler required - #endif - - #ifndef FLEXT_CPU - #if defined(__POWERPC__) - #define FLEXT_CPU FLEXT_CPU_PPC - #else - #define FLEXT_CPU FLEXT_CPU_UNKNOWN - #endif - #endif - - #ifndef FLEXT_OS - #if defined(macintosh) - #define FLEXT_OS FLEXT_OS_MAC - #else - #define FLEXT_OS FLEXT_OS_UNKNOWN - #endif - #endif - - #ifndef FLEXT_OSAPI - #if FLEXT_OS == FLEXT_OS_MAC - #define FLEXT_OSAPI FLEXT_OSAPI_MAC_CLASSIC - #else - #define FLEXT_OSAPI FLEXT_OSAPI_UNKNOWN - #endif - #endif + // Apple MPW MrCpp + + #if __MRC__ < 0x500 + #error Apple MPW MrCpp v.5.0.0 or later compiler required + #endif + + #ifndef FLEXT_CPU + #if defined(__POWERPC__) + #define FLEXT_CPU FLEXT_CPU_PPC + #else + #define FLEXT_CPU FLEXT_CPU_UNKNOWN + #endif + #endif + + #ifndef FLEXT_OS + #if defined(macintosh) + #define FLEXT_OS FLEXT_OS_MAC + #else + #define FLEXT_OS FLEXT_OS_UNKNOWN + #endif + #endif + + #ifndef FLEXT_OSAPI + #if FLEXT_OS == FLEXT_OS_MAC + #define FLEXT_OSAPI FLEXT_OSAPI_MAC_CLASSIC + #else + #define FLEXT_OSAPI FLEXT_OSAPI_UNKNOWN + #endif + #endif #endif #if FLEXT_OS == FLEXT_OS_WIN -// #pragma message("Compiling for Windows") - - #if FLEXT_SYS == FLEXT_SYS_MAX -// #define WIN_VERSION 1 - #elif FLEXT_SYS == FLEXT_SYS_PD -// #define PD -// #define NT - #endif +// #pragma message("Compiling for Windows") + + #if FLEXT_SYS == FLEXT_SYS_MAX +// #define WIN_VERSION 1 + #elif FLEXT_SYS == FLEXT_SYS_PD +// #define PD +// #define NT + #endif #elif FLEXT_OS == FLEXT_OS_LINUX -// #pragma message("Compiling for Linux") +// #pragma message("Compiling for Linux") - #if FLEXT_SYS == FLEXT_SYS_PD -// #define PD - #else - #error "Flext SYS/OS combination unknown" - #endif + #if FLEXT_SYS == FLEXT_SYS_PD +// #define PD + #else + #error "Flext SYS/OS combination unknown" + #endif #elif FLEXT_OS == FLEXT_OS_IRIX -// #pragma message("Compiling for Irix") +// #pragma message("Compiling for Irix") - #if FLEXT_SYS == FLEXT_SYS_PD -// #define PD - #else - #error "Flext SYS/OS combination unknown" - #endif + #if FLEXT_SYS == FLEXT_SYS_PD +// #define PD + #else + #error "Flext SYS/OS combination unknown" + #endif #elif FLEXT_OS == FLEXT_OS_MAC -// #pragma message("Compiling for MacOS") +// #pragma message("Compiling for MacOS") - #if FLEXT_SYS == FLEXT_SYS_PD -// #define PD - #endif + #if FLEXT_SYS == FLEXT_SYS_PD +// #define PD + #endif #else - #error "Operating system could not be determined" + #error "Operating system could not be determined" #endif #if FLEXT_SYS == FLEXT_SYS_MAX -// #pragma message("Compiling for Max/MSP") +// #pragma message("Compiling for Max/MSP") #elif FLEXT_SYS == FLEXT_SYS_PD -// #pragma message("Compiling for PD") +// #pragma message("Compiling for PD") #endif // ----- set threading model ----- // shared builds are always threaded (although this not be so....) #ifdef FLEXT_SHARED - #undef FLEXT_THREADS - #define FLEXT_THREADS + #undef FLEXT_THREADS + #define FLEXT_THREADS /* - // and also enabled for virtual daughter-classes?? - #undef FLEXT_VIRT - #define FLEXT_VIRT + // and also enabled for virtual daughter-classes?? + #undef FLEXT_VIRT + #define FLEXT_VIRT */ #endif #ifdef FLEXT_THREADS - #undef FLEXT_THREADS - #if FLEXT_OS == FLEXT_OS_MAC && FLEXT_SYS == FLEXT_SYS_MAX - // Max crashes with posix threads (because it's in the CFM model) - #define FLEXT_THREADS FLEXT_THR_MP - #elif FLEXT_SYS == FLEXT_SYS_MAX && FLEXT_OS == FLEXT_OS_WIN - // for wmax use native Windows threads - #define FLEXT_THREADS FLEXT_THR_WIN32 - #else - #define FLEXT_THREADS FLEXT_THR_POSIX - #endif + #undef FLEXT_THREADS + #if FLEXT_OS == FLEXT_OS_MAC && FLEXT_SYS == FLEXT_SYS_MAX + // Max crashes with posix threads (because it's in the CFM model) + #define FLEXT_THREADS FLEXT_THR_MP + #elif FLEXT_SYS == FLEXT_SYS_MAX && FLEXT_OS == FLEXT_OS_WIN + // for wmax use native Windows threads + #define FLEXT_THREADS FLEXT_THR_WIN32 + #else + #define FLEXT_THREADS FLEXT_THR_POSIX + #endif #endif // ----- macros for class names ----- /* With linux (flat linker namespace) and more than one flext-based external loaded all calls to static exported functions refer to the first instance loaded! - Therefore different class names are used so that the correct type of flext function is called. + Therefore different class names are used so that the correct type of flext function is called. */ #if defined(FLEXT_SHARED) - #define FLEXT_CLASSDEF(CL) CL##_shared + #define FLEXT_CLASSDEF(CL) CL##_shared #elif defined(FLEXT_THREADS) - #define FLEXT_CLASSDEF(CL) CL##_multi + #define FLEXT_CLASSDEF(CL) CL##_multi #else - #define FLEXT_CLASSDEF(CL) CL##_single + #define FLEXT_CLASSDEF(CL) CL##_single #endif // std namespace -- cgit v1.2.1