forked from bartvdbraak/blender
Remove mingw-w64 errors from loss of precision by converting 64bit pointers to ints. All cases found were harmless and the error behaviour could be turned off by the -fpermissive flag but I'd rather keep that off to detect any real problems should they arise.
This commit is contained in:
parent
4782522379
commit
0db3c5f743
@ -1008,8 +1008,9 @@ elseif(WIN32)
|
|||||||
|
|
||||||
if(WITH_MINGW64)
|
if(WITH_MINGW64)
|
||||||
#Yes, the point for MinGW64 is moar optimization by default :)
|
#Yes, the point for MinGW64 is moar optimization by default :)
|
||||||
set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -mmmx -msse -msse2 -O3")
|
set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -mmmx -msse -msse2")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
|
set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG")
|
||||||
|
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
|
||||||
set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS} -lpthread")
|
set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS} -lpthread")
|
||||||
|
|
||||||
add_definitions(-DFREE_WINDOWS64 -DMS_WIN64)
|
add_definitions(-DFREE_WINDOWS64 -DMS_WIN64)
|
||||||
|
@ -176,7 +176,7 @@ CC = 'gcc'
|
|||||||
CXX = 'g++'
|
CXX = 'g++'
|
||||||
|
|
||||||
CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
|
CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
|
||||||
CXXFLAGS = [ '-fpermissive' ]
|
#CXXFLAGS = [ '-fpermissive' ]
|
||||||
|
|
||||||
CPPFLAGS = ['-DWIN32', '-DMS_WIN64', '-DFREE_WINDOWS', '-DFREE_WINDOWS64', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE', '-DBOOST_ALL_NO_LIB', '-DBOOST_THREAD_USE_LIB', '-DGLEW_STATIC', '-D_SSIZE_T_']
|
CPPFLAGS = ['-DWIN32', '-DMS_WIN64', '-DFREE_WINDOWS', '-DFREE_WINDOWS64', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE', '-DBOOST_ALL_NO_LIB', '-DBOOST_THREAD_USE_LIB', '-DGLEW_STATIC', '-D_SSIZE_T_']
|
||||||
REL_CFLAGS = ['-O3', '-mmmx', '-msse', '-msse2']
|
REL_CFLAGS = ['-O3', '-mmmx', '-msse', '-msse2']
|
||||||
|
39
extern/bullet2/patches/MinGW64-nopermissive.patch
vendored
Normal file
39
extern/bullet2/patches/MinGW64-nopermissive.patch
vendored
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
Index: LinearMath/btSerializer.h
|
||||||
|
===================================================================
|
||||||
|
--- LinearMath/btSerializer.h (revision 45919)
|
||||||
|
+++ LinearMath/btSerializer.h (working copy)
|
||||||
|
@@ -25,8 +25,15 @@
|
||||||
|
#endif
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
+#if defined(_WIN64)
|
||||||
|
+# ifdef __MINGW64__
|
||||||
|
+# include <basetsd.h>
|
||||||
|
+# endif
|
||||||
|
+typedef __int64 int_ptr;
|
||||||
|
+#else
|
||||||
|
+typedef long int_ptr;
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
-
|
||||||
|
///only the 32bit versions for now
|
||||||
|
extern unsigned char sBulletDNAstr[];
|
||||||
|
extern int sBulletDNAlen;
|
||||||
|
@@ -247,7 +254,7 @@
|
||||||
|
cp++;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
- nr= (long)cp;
|
||||||
|
+ nr= (int_ptr)cp;
|
||||||
|
// long mask=3;
|
||||||
|
nr= ((nr+3)&~3)-nr;
|
||||||
|
while (nr--)
|
||||||
|
@@ -282,7 +289,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
- nr= (long)cp;
|
||||||
|
+ nr= (int_ptr)cp;
|
||||||
|
// long mask=3;
|
||||||
|
nr= ((nr+3)&~3)-nr;
|
||||||
|
while (nr--)
|
13
extern/bullet2/src/LinearMath/btSerializer.h
vendored
13
extern/bullet2/src/LinearMath/btSerializer.h
vendored
@ -25,7 +25,14 @@ subject to the following restrictions:
|
|||||||
#endif
|
#endif
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#if defined(_WIN64)
|
||||||
|
# ifdef __MINGW64__
|
||||||
|
# include <basetsd.h>
|
||||||
|
# endif
|
||||||
|
typedef __int64 int_ptr;
|
||||||
|
#else
|
||||||
|
typedef long int_ptr;
|
||||||
|
#endif
|
||||||
|
|
||||||
///only the 32bit versions for now
|
///only the 32bit versions for now
|
||||||
extern unsigned char sBulletDNAstr[];
|
extern unsigned char sBulletDNAstr[];
|
||||||
@ -247,7 +254,7 @@ protected:
|
|||||||
cp++;
|
cp++;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
nr= (long)cp;
|
nr= (int_ptr)cp;
|
||||||
// long mask=3;
|
// long mask=3;
|
||||||
nr= ((nr+3)&~3)-nr;
|
nr= ((nr+3)&~3)-nr;
|
||||||
while (nr--)
|
while (nr--)
|
||||||
@ -282,7 +289,7 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
nr= (long)cp;
|
nr= (int_ptr)cp;
|
||||||
// long mask=3;
|
// long mask=3;
|
||||||
nr= ((nr+3)&~3)-nr;
|
nr= ((nr+3)&~3)-nr;
|
||||||
while (nr--)
|
while (nr--)
|
||||||
|
@ -33,7 +33,16 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
#define AUD_ALIGN(a) (a + 16 - ((long)a & 15))
|
#if defined(_WIN64)
|
||||||
|
# ifdef __MINGW64__
|
||||||
|
# include <basetsd.h>
|
||||||
|
# endif
|
||||||
|
typedef unsigned __int64 uint_ptr;
|
||||||
|
#else
|
||||||
|
typedef unsigned long uint_ptr;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define AUD_ALIGN(a) (a + 16 - ((uint_ptr)a & 15))
|
||||||
|
|
||||||
AUD_Buffer::AUD_Buffer(int size)
|
AUD_Buffer::AUD_Buffer(int size)
|
||||||
{
|
{
|
||||||
|
23
intern/audaspace/patches/mingw64-nopermissive.patch
Normal file
23
intern/audaspace/patches/mingw64-nopermissive.patch
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
Index: intern/AUD_Buffer.cpp
|
||||||
|
===================================================================
|
||||||
|
--- intern/AUD_Buffer.cpp (revision 45919)
|
||||||
|
+++ intern/AUD_Buffer.cpp (working copy)
|
||||||
|
@@ -33,8 +33,17 @@
|
||||||
|
#include <cstring>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
|
-#define AUD_ALIGN(a) (a + 16 - ((long)a & 15))
|
||||||
|
+#if defined(_WIN64)
|
||||||
|
+# ifdef __MINGW64__
|
||||||
|
+# include <basetsd.h>
|
||||||
|
+# endif
|
||||||
|
+typedef unsigned __int64 uint_ptr;
|
||||||
|
+#else
|
||||||
|
+typedef unsigned long uint_ptr;
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
+#define AUD_ALIGN(a) (a + 16 - ((uint_ptr)a & 15))
|
||||||
|
+
|
||||||
|
AUD_Buffer::AUD_Buffer(int size)
|
||||||
|
{
|
||||||
|
m_size = size;
|
@ -21,7 +21,14 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif // WIN32
|
#endif // WIN32
|
||||||
|
|
||||||
|
#if defined(_WIN64)
|
||||||
|
# ifdef __MINGW64__
|
||||||
|
# include <basetsd.h>
|
||||||
|
# endif
|
||||||
|
typedef __int64 int_ptr;
|
||||||
|
#else
|
||||||
|
typedef long int_ptr;
|
||||||
|
#endif
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Default Constructor
|
* Default Constructor
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
@ -164,7 +171,7 @@ int ntlGeometryObjModel::initModel(int numVertices, float *vertices, int numTria
|
|||||||
}
|
}
|
||||||
|
|
||||||
//fprintf(stderr,"initModel DEBUG %d \n",channelSize);
|
//fprintf(stderr,"initModel DEBUG %d \n",channelSize);
|
||||||
debMsgStd("ntlGeometryObjModel::initModel",DM_MSG, "Csize:"<<channelSize<<", Cvert:"<<(long)(channelVertices) ,10);
|
debMsgStd("ntlGeometryObjModel::initModel",DM_MSG, "Csize:"<<channelSize<<", Cvert:"<<(int_ptr)(channelVertices) ,10);
|
||||||
if(channelVertices && (channelSize>0)) {
|
if(channelVertices && (channelSize>0)) {
|
||||||
vector<ntlSetVec3f> aniverts;
|
vector<ntlSetVec3f> aniverts;
|
||||||
vector<ntlSetVec3f> aninorms;
|
vector<ntlSetVec3f> aninorms;
|
||||||
|
29
intern/elbeem/patches/mingw64_nopermissive.patch
Normal file
29
intern/elbeem/patches/mingw64_nopermissive.patch
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
Index: intern/ntl_geometrymodel.cpp
|
||||||
|
===================================================================
|
||||||
|
--- intern/ntl_geometrymodel.cpp (revision 45919)
|
||||||
|
+++ intern/ntl_geometrymodel.cpp (working copy)
|
||||||
|
@@ -21,7 +21,14 @@
|
||||||
|
#endif
|
||||||
|
#endif // WIN32
|
||||||
|
|
||||||
|
-
|
||||||
|
+#if defined(_WIN64)
|
||||||
|
+# ifdef __MINGW64__
|
||||||
|
+# include <basetsd.h>
|
||||||
|
+# endif
|
||||||
|
+typedef __int64 int_ptr;
|
||||||
|
+#else
|
||||||
|
+typedef long int_ptr;
|
||||||
|
+#endif
|
||||||
|
/******************************************************************************
|
||||||
|
* Default Constructor
|
||||||
|
*****************************************************************************/
|
||||||
|
@@ -164,7 +171,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
//fprintf(stderr,"initModel DEBUG %d \n",channelSize);
|
||||||
|
- debMsgStd("ntlGeometryObjModel::initModel",DM_MSG, "Csize:"<<channelSize<<", Cvert:"<<(long)(channelVertices) ,10);
|
||||||
|
+ debMsgStd("ntlGeometryObjModel::initModel",DM_MSG, "Csize:"<<channelSize<<", Cvert:"<<(int_ptr)(channelVertices) ,10);
|
||||||
|
if(channelVertices && (channelSize>0)) {
|
||||||
|
vector<ntlSetVec3f> aniverts;
|
||||||
|
vector<ntlSetVec3f> aninorms;
|
@ -28,13 +28,15 @@
|
|||||||
/** \file gameengine/Expressions/KX_HashedPtr.cpp
|
/** \file gameengine/Expressions/KX_HashedPtr.cpp
|
||||||
* \ingroup expressions
|
* \ingroup expressions
|
||||||
*/
|
*/
|
||||||
|
#ifdef __MINGW64__
|
||||||
|
#include <basetsd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "KX_HashedPtr.h"
|
#include "KX_HashedPtr.h"
|
||||||
|
|
||||||
unsigned int KX_Hash(void * inDWord)
|
unsigned int KX_Hash(void * inDWord)
|
||||||
{
|
{
|
||||||
#if defined(_WIN64) && !defined(FREE_WINDOWS64)
|
#ifdef _WIN64
|
||||||
unsigned __int64 key = (unsigned __int64)inDWord;
|
unsigned __int64 key = (unsigned __int64)inDWord;
|
||||||
#else
|
#else
|
||||||
unsigned long key = (unsigned long)inDWord;
|
unsigned long key = (unsigned long)inDWord;
|
||||||
|
@ -31,7 +31,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#if defined(_WIN64) && !defined(FREE_WINDOWS64)
|
#if defined(_WIN64)
|
||||||
|
# ifdef __MINGW64__
|
||||||
|
# include <basetsd.h>
|
||||||
|
# endif
|
||||||
typedef unsigned __int64 uint_ptr;
|
typedef unsigned __int64 uint_ptr;
|
||||||
#else
|
#else
|
||||||
typedef unsigned long uint_ptr;
|
typedef unsigned long uint_ptr;
|
||||||
|
@ -31,7 +31,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#if defined(_WIN64) && !defined(FREE_WINDOWS64)
|
#if defined(_WIN64)
|
||||||
|
# ifdef __MINGW64__
|
||||||
|
# include <basetsd.h>
|
||||||
|
# endif
|
||||||
typedef unsigned __int64 uint_ptr;
|
typedef unsigned __int64 uint_ptr;
|
||||||
#else
|
#else
|
||||||
typedef unsigned long uint_ptr;
|
typedef unsigned long uint_ptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user