Fixed mingw compilation

This commit is contained in:
deve 2014-09-12 09:01:35 +02:00
parent e19ab67571
commit e6ab299f37
2 changed files with 15 additions and 15 deletions

View File

@ -75,17 +75,17 @@ endif()
include_directories(${STK_SOURCE_DIR}) include_directories(${STK_SOURCE_DIR})
# These variables enable MSVC to find libraries located in "dependencies" # These variables enable MSVC to find libraries located in "dependencies"
if(MSVC) if(WIN32)
set(ENV{PATH} ${PROJECT_SOURCE_DIR}/dependencies/include) set(ENV{PATH} "$ENV{PATH};${PROJECT_SOURCE_DIR}/dependencies/include")
set(ENV{LIB} ${PROJECT_SOURCE_DIR}/dependencies/lib) set(ENV{LIB} ${PROJECT_SOURCE_DIR}/dependencies/lib)
set(ENV{OPENALDIR} ${PROJECT_SOURCE_DIR}/dependencies) set(ENV{OPENALDIR} ${PROJECT_SOURCE_DIR}/dependencies)
add_definitions(/D_IRR_STATIC_LIB_) if(MSVC)
add_definitions(/D_IRR_STATIC_LIB_)
elseif(MINGW)
add_definitions(-D_IRR_STATIC_LIB_)
endif()
endif() endif()
if(MINGW)
set(ENV{OPENALDIR} ${PROJECT_SOURCE_DIR}/dependencies)
add_definitions(-D_IRR_STATIC_LIB_)
endif()
if(APPLE) if(APPLE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch i386") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch i386")

View File

@ -12,8 +12,8 @@
#include "aabbox3d.h" #include "aabbox3d.h"
#include "rect.h" #include "rect.h"
#include "irrString.h" #include "irrString.h"
#if defined(WIN32) && (defined(__x86_64__) || defined(_M_X64) || defined(__i386) || defined(_M_IX86)) #if defined(WIN32) && !defined(__MINGW32__) && (defined(__x86_64__) || defined(_M_X64) || defined(__i386) || defined(_M_IX86))
#include <intrin.h> #include <intrin.h>
#endif #endif
// enable this to keep track of changes to the matrix // enable this to keep track of changes to the matrix
@ -48,7 +48,7 @@ namespace core
class CMatrix4 class CMatrix4
{ {
private: private:
#if defined(WIN32) && (defined(__x86_64__) || defined(_M_X64) || defined(__i386) || defined(_M_IX86)) #if defined(WIN32) && !defined(__MINGW32__) && (defined(__x86_64__) || defined(_M_X64) || defined(__i386) || defined(_M_IX86))
float M_raw[24]; float M_raw[24];
#endif #endif
public: public:
@ -409,7 +409,7 @@ namespace core
bool equals(const core::CMatrix4<T>& other, const T tolerance=(T)ROUNDING_ERROR_f64) const; bool equals(const core::CMatrix4<T>& other, const T tolerance=(T)ROUNDING_ERROR_f64) const;
private: private:
#if defined(WIN32) && (defined(__x86_64__) || defined(_M_X64) || defined(__i386) || defined(_M_IX86)) #if defined(WIN32) && !defined(__MINGW32__) && (defined(__x86_64__) || defined(_M_X64) || defined(__i386) || defined(_M_IX86))
//! Matrix data, stored in row-major order //! Matrix data, stored in row-major order
T* M = (T*)((uintptr_t)&M_raw[4] & ~0xF); T* M = (T*)((uintptr_t)&M_raw[4] & ~0xF);
#else #else
@ -669,7 +669,7 @@ namespace core
const T *m1 = other_a.M; const T *m1 = other_a.M;
const T *m2 = other_b.M; const T *m2 = other_b.M;
#if defined(WIN32) && (defined(__x86_64__) || defined(_M_X64) || defined(__i386) || defined(_M_IX86)) #if defined(WIN32) && !defined(__MINGW32__) && (defined(__x86_64__) || defined(_M_X64) || defined(__i386) || defined(_M_IX86))
// From http://drrobsjournal.blogspot.fr/2012/10/fast-simd-4x4-matrix-multiplication.html // From http://drrobsjournal.blogspot.fr/2012/10/fast-simd-4x4-matrix-multiplication.html
// Use unaligned load/store // Use unaligned load/store
@ -1019,13 +1019,13 @@ namespace core
const f64 t = 1.0 - c; const f64 t = 1.0 - c;
const f64 tx = t * axis.X; const f64 tx = t * axis.X;
const f64 ty = t * axis.Y; const f64 ty = t * axis.Y;
const f64 tz = t * axis.Z; const f64 tz = t * axis.Z;
const f64 sx = s * axis.X; const f64 sx = s * axis.X;
const f64 sy = s * axis.Y; const f64 sy = s * axis.Y;
const f64 sz = s * axis.Z; const f64 sz = s * axis.Z;
M[0] = (T)(tx * axis.X + c); M[0] = (T)(tx * axis.X + c);
M[1] = (T)(tx * axis.Y + sz); M[1] = (T)(tx * axis.Y + sz);
M[2] = (T)(tx * axis.Z - sy); M[2] = (T)(tx * axis.Z - sy);
@ -1385,7 +1385,7 @@ namespace core
} }
#endif #endif
const CMatrix4<T> &m = *this; const CMatrix4<T> &m = *this;
#if defined(WIN32) && (defined(__x86_64__) || defined(_M_X64) || defined(__i386) || defined(_M_IX86)) #if defined(WIN32) && !defined(__MINGW32__) && (defined(__x86_64__) || defined(_M_X64) || defined(__i386) || defined(_M_IX86))
float *src = (float*)m.pointer(); float *src = (float*)m.pointer();
float *dst = (float*)out.pointer(); float *dst = (float*)out.pointer();
// from http://www.intel.com/design/pentiumiii/sml/245043.htm // from http://www.intel.com/design/pentiumiii/sml/245043.htm