diff --git a/Sources/Engine/Math/Float.cpp b/Sources/Engine/Math/Float.cpp old mode 100644 new mode 100755 index 1466160..7770d37 --- a/Sources/Engine/Math/Float.cpp +++ b/Sources/Engine/Math/Float.cpp @@ -17,32 +17,30 @@ with this program; if not, write to the Free Software Foundation, Inc., #include -#if (defined __GNU_INLINE__) -#define MCW_PC 0x0300 +#define MCW_PC 0x0300 #define _MCW_PC MCW_PC -#define _PC_24 0x0000 -#define _PC_53 0x0200 -#define _PC_64 0x0300 +#define _PC_24 0x0000 +#define _PC_53 0x0200 +#define _PC_64 0x0300 + +#ifdef USE_PORTABLE_C +// Fake control87 for USE_PORTABLE_C version +inline ULONG _control87(WORD newcw, WORD mask) +{ + static WORD fpw=_PC_64; + if (mask != 0) + { + fpw &= ~mask; + fpw |= (newcw & mask); + } + return(fpw); +} +#else + +#if (defined __GNU_INLINE__) inline ULONG _control87(WORD newcw, WORD mask) { -#if __POWERPC__ - static WORD fpw=_PC_64; - if (mask != 0) - { - fpw &= ~mask; - fpw |= (newcw & mask); - } - return(fpw); -#elif defined(__arm__) - static WORD fpw=_PC_64; - if (mask != 0) - { - fpw &= ~mask; - fpw |= (newcw & mask); - } - return(fpw); -#else WORD fpw = 0; // get the current FPU control word... @@ -55,16 +53,10 @@ inline ULONG _control87(WORD newcw, WORD mask) __asm__ __volatile__ (" fldcw %0" : : "m" (fpw) : "memory"); } return(fpw); -#endif } // (for intel compiler...) #elif ((defined __MSVC_INLINE__) && (!defined _MSC_VER)) -#define MCW_PC 0x0300 -#define _MCW_PC MCW_PC -#define _PC_24 0x0000 -#define _PC_53 0x0200 -#define _PC_64 0x0300 inline ULONG _control87(WORD newcw, WORD mask) { @@ -85,7 +77,7 @@ inline ULONG _control87(WORD newcw, WORD mask) #elif (!defined _MSC_VER) #error Implement for your platform, or add a stub conditional here. #endif - +#endif /* Get current precision setting of FPU. */ enum FPUPrecisionType GetFPUPrecision(void) {