[Libreoffice-commits] core.git: external/box2d

Sarper Akdemir (via logerrit) logerrit at kemper.freedesktop.org
Fri Jun 19 23:42:11 UTC 2020


 external/box2d/UnpackedTarball_box2d.mk               |    7 +++++++
 external/box2d/disable-shadow-warning-for-drawh.patch |   18 ++++++++++++++++++
 external/box2d/fix-strict-aliasing-error.patch        |   13 +++++++++++++
 3 files changed, 38 insertions(+)

New commits:
commit a46ab778d93d535d5866c7d0cc4a609bcf38182e
Author:     Sarper Akdemir <q.sarperakdemir at gmail.com>
AuthorDate: Tue Jun 16 09:33:14 2020 +0300
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Sat Jun 20 01:41:37 2020 +0200

    box2d: fix strict aliasing error and ignore -Wshadow
    
    Adding two patches to static external library box2d
    getting rid of strict aliasing error and ignoring
    -Wshadow in b2Draw.h to get rid of errors while building.
    
    Change-Id: I5752eb484d6aafe057c9102b1ed87aaf31d6555c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96559
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/external/box2d/UnpackedTarball_box2d.mk b/external/box2d/UnpackedTarball_box2d.mk
index 340a17511711..4dd03e69f2d0 100644
--- a/external/box2d/UnpackedTarball_box2d.mk
+++ b/external/box2d/UnpackedTarball_box2d.mk
@@ -11,4 +11,11 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,box2d))
 
 $(eval $(call gb_UnpackedTarball_set_tarball,box2d,$(BOX2D_TARBALL)))
 
+$(eval $(call gb_UnpackedTarball_set_patchlevel,box2d,1))
+
+$(eval $(call gb_UnpackedTarball_add_patches,box2d, \
+	external/box2d/fix-strict-aliasing-error.patch \
+	external/box2d/disable-shadow-warning-for-drawh.patch \
+))
+
 # vim: set noet sw=4 ts=4:
diff --git a/external/box2d/disable-shadow-warning-for-drawh.patch b/external/box2d/disable-shadow-warning-for-drawh.patch
new file mode 100644
index 000000000000..316a6ff9e284
--- /dev/null
+++ b/external/box2d/disable-shadow-warning-for-drawh.patch
@@ -0,0 +1,18 @@
+diff -ur box2d/Box2D/Box2D/Box2D.h box2d_patched/Box2D/Box2D/Box2D.h
+--- box2d/Box2D/Box2D/Box2D.h	2014-04-06 03:43:12.000000000 +0300
++++ box2d_patched/Box2D/Box2D/Box2D.h	2020-06-17 18:44:25.920658966 +0300
+@@ -32,7 +32,14 @@
+ // These include files constitute the main Box2D API
+ 
+ #include <Box2D/Common/b2Settings.h>
++#if defined __GNUC__
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wshadow"
++#endif
+ #include <Box2D/Common/b2Draw.h>
++#if defined __GNUC__
++#pragma GCC diagnostic pop
++#endif
+ #include <Box2D/Common/b2Timer.h>
+ 
+ #include <Box2D/Collision/Shapes/b2CircleShape.h>
diff --git a/external/box2d/fix-strict-aliasing-error.patch b/external/box2d/fix-strict-aliasing-error.patch
new file mode 100644
index 000000000000..20b5e49eb936
--- /dev/null
+++ b/external/box2d/fix-strict-aliasing-error.patch
@@ -0,0 +1,13 @@
+diff -ru box2d/Box2D/Box2D/Common/b2Math.h box2d_patched/Box2D/Box2D/Common/b2Math.h
+--- box2d/Box2D/Box2D/Common/b2Math.h	2014-04-06 03:43:12.000000000 +0300
++++ box2d_patched/Box2D/Box2D/Common/b2Math.h	2020-06-16 07:37:31.713248714 +0300
+@@ -25,8 +25,7 @@
+ /// This function is used to ensure that a floating point number is not a NaN or infinity.
+ inline bool b2IsValid(float32 x)
+ {
+-	int32 ix = *reinterpret_cast<int32*>(&x);
+-	return (ix & 0x7f800000) != 0x7f800000;
++	return isfinite(x);
+ }
+ 
+ /// This is a approximate yet fast inverse square-root.


More information about the Libreoffice-commits mailing list