summaryrefslogtreecommitdiffstats
path: root/thirdparty/clipper2/patches/llvm-error.patch
diff options
context:
space:
mode:
authorGeorge L. Albany <Megacake1234@gmail.com>2024-11-27 21:15:49 +0000
committerGitHub <noreply@github.com>2024-11-27 21:15:49 +0000
commit85d87116e184e7923b8d6804cab2681b61c62d83 (patch)
tree55ec5bfa061a5c27272b831e697b78ed1b756a70 /thirdparty/clipper2/patches/llvm-error.patch
parentb06d20bf39d15ec736d08d4e4fcb32e0c3c1ce1e (diff)
parent721f53fde47c2727d99e3ecccdb789a67df36de0 (diff)
downloadredot-engine-85d87116e184e7923b8d6804cab2681b61c62d83.tar.gz
Merge pull request #886 from Spartan322/merge/f128f38HEADmaster
Merge commit godotengine/godot@f128f38
Diffstat (limited to 'thirdparty/clipper2/patches/llvm-error.patch')
-rw-r--r--thirdparty/clipper2/patches/llvm-error.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/thirdparty/clipper2/patches/llvm-error.patch b/thirdparty/clipper2/patches/llvm-error.patch
new file mode 100644
index 0000000000..e326d73e83
--- /dev/null
+++ b/thirdparty/clipper2/patches/llvm-error.patch
@@ -0,0 +1,34 @@
+diff --git a/thirdparty/clipper2/include/clipper2/clipper.core.h b/thirdparty/clipper2/include/clipper2/clipper.core.h
+index 67dd731af6..0f69bf2d9f 100644
+--- a/thirdparty/clipper2/include/clipper2/clipper.core.h
++++ b/thirdparty/clipper2/include/clipper2/clipper.core.h
+@@ -695,11 +695,13 @@ namespace Clipper2Lib
+ // returns true if (and only if) a * b == c * d
+ inline bool ProductsAreEqual(int64_t a, int64_t b, int64_t c, int64_t d)
+ {
+-#if (defined(__clang__) || defined(__GNUC__)) && UINTPTR_MAX >= UINT64_MAX
+- const auto ab = static_cast<__int128_t>(a) * static_cast<__int128_t>(b);
+- const auto cd = static_cast<__int128_t>(c) * static_cast<__int128_t>(d);
+- return ab == cd;
+-#else
++// -- GODOT start --
++// #if (defined(__clang__) || defined(__GNUC__)) && UINTPTR_MAX >= UINT64_MAX
++// const auto ab = static_cast<__int128_t>(a) * static_cast<__int128_t>(b);
++// const auto cd = static_cast<__int128_t>(c) * static_cast<__int128_t>(d);
++// return ab == cd;
++// #else
++// -- GODOT end --
+ // nb: unsigned values needed for calculating overflow carry
+ const auto abs_a = static_cast<uint64_t>(std::abs(a));
+ const auto abs_b = static_cast<uint64_t>(std::abs(b));
+@@ -714,7 +716,9 @@ namespace Clipper2Lib
+ const auto sign_cd = TriSign(c) * TriSign(d);
+
+ return abs_ab == abs_cd && sign_ab == sign_cd;
+-#endif
++// -- GODOT start --
++// #endif
++// -- GODOT end --
+ }
+
+ template <typename T>