From 0db3c5f74300980d35b3114992c299f072b913b1 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Tue, 24 Apr 2012 14:33:44 +0000 Subject: 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. --- extern/bullet2/patches/MinGW64-nopermissive.patch | 39 +++++++++++++++++++++++ extern/bullet2/src/LinearMath/btSerializer.h | 13 ++++++-- 2 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 extern/bullet2/patches/MinGW64-nopermissive.patch (limited to 'extern/bullet2') diff --git a/extern/bullet2/patches/MinGW64-nopermissive.patch b/extern/bullet2/patches/MinGW64-nopermissive.patch new file mode 100644 index 00000000000..915f232f6d7 --- /dev/null +++ b/extern/bullet2/patches/MinGW64-nopermissive.patch @@ -0,0 +1,39 @@ +Index: LinearMath/btSerializer.h +=================================================================== +--- LinearMath/btSerializer.h (revision 45919) ++++ LinearMath/btSerializer.h (working copy) +@@ -25,8 +25,15 @@ + #endif + #include + ++#if defined(_WIN64) ++# ifdef __MINGW64__ ++# include ++# 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--) diff --git a/extern/bullet2/src/LinearMath/btSerializer.h b/extern/bullet2/src/LinearMath/btSerializer.h index 8a89374c612..a1e766c95ce 100644 --- a/extern/bullet2/src/LinearMath/btSerializer.h +++ b/extern/bullet2/src/LinearMath/btSerializer.h @@ -25,7 +25,14 @@ subject to the following restrictions: #endif #include - +#if defined(_WIN64) +# ifdef __MINGW64__ +# include +# endif +typedef __int64 int_ptr; +#else +typedef long int_ptr; +#endif ///only the 32bit versions for now extern unsigned char sBulletDNAstr[]; @@ -247,7 +254,7 @@ protected: cp++; } { - nr= (long)cp; + nr= (int_ptr)cp; // long mask=3; nr= ((nr+3)&~3)-nr; while (nr--) @@ -282,7 +289,7 @@ protected: } { - nr= (long)cp; + nr= (int_ptr)cp; // long mask=3; nr= ((nr+3)&~3)-nr; while (nr--) -- cgit v1.2.3