summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorScott Shawcroft <scott@adafruit.com>2020-01-29 11:45:08 -0800
committerGitHub <noreply@github.com>2020-01-29 11:45:08 -0800
commit5b6b4eb326ce2f7beca20ccdc81fdef422e45848 (patch)
treeb09fa8639a80b7f6fd64f3a266189a258181d245 /py
parent7d4f9fc99f07e050b028a2acaeb329ee3931f3b5 (diff)
parent0b7551f4c7af0fd6344386312f64d894cf4bd09b (diff)
Merge pull request #2551 from jepler/build-mpy-cross-static-linux-win64
Build static binaries of mpy-cross for desktop linux, desktop windows, mac, and raspbian
Diffstat (limited to 'py')
-rw-r--r--py/sequence.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/py/sequence.c b/py/sequence.c
index a750e5bac..0e668ea2a 100644
--- a/py/sequence.c
+++ b/py/sequence.c
@@ -34,6 +34,11 @@
#define SWAP(type, var1, var2) { type t = var2; var2 = var1; var1 = t; }
+#if __GNUC__ < 5
+// n.b. does not actually detect overflow!
+#define __builtin_mul_overflow(a, b, x) (*(x) = (a) * (b), false)
+#endif
+
// Detect when a multiply causes an overflow.
size_t mp_seq_multiply_len(size_t item_sz, size_t len) {
size_t new_len;