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})
# These variables enable MSVC to find libraries located in "dependencies"
if(MSVC)
set(ENV{PATH} ${PROJECT_SOURCE_DIR}/dependencies/include)
if(WIN32)
set(ENV{PATH} "$ENV{PATH};${PROJECT_SOURCE_DIR}/dependencies/include")
set(ENV{LIB} ${PROJECT_SOURCE_DIR}/dependencies/lib)
set(ENV{OPENALDIR} ${PROJECT_SOURCE_DIR}/dependencies)
if(MSVC)
add_definitions(/D_IRR_STATIC_LIB_)
endif()
if(MINGW)
set(ENV{OPENALDIR} ${PROJECT_SOURCE_DIR}/dependencies)
elseif(MINGW)
add_definitions(-D_IRR_STATIC_LIB_)
endif()
endif()
if(APPLE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch i386")

View File

@ -12,7 +12,7 @@
#include "aabbox3d.h"
#include "rect.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>
#endif
@ -48,7 +48,7 @@ namespace core
class CMatrix4
{
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];
#endif
public:
@ -409,7 +409,7 @@ namespace core
bool equals(const core::CMatrix4<T>& other, const T tolerance=(T)ROUNDING_ERROR_f64) const;
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
T* M = (T*)((uintptr_t)&M_raw[4] & ~0xF);
#else
@ -669,7 +669,7 @@ namespace core
const T *m1 = other_a.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
// Use unaligned load/store
@ -1385,7 +1385,7 @@ namespace core
}
#endif
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 *dst = (float*)out.pointer();
// from http://www.intel.com/design/pentiumiii/sml/245043.htm