aboutsummaryrefslogtreecommitdiffstats
path: root/main/cmocka/wordsize.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/cmocka/wordsize.patch')
-rw-r--r--main/cmocka/wordsize.patch21
1 files changed, 21 insertions, 0 deletions
diff --git a/main/cmocka/wordsize.patch b/main/cmocka/wordsize.patch
new file mode 100644
index 0000000000..bd514018ba
--- /dev/null
+++ b/main/cmocka/wordsize.patch
@@ -0,0 +1,21 @@
+musl defines __WORDSIZE in bits/reg.h so include that. Also
+error out on if it's not defined, otherwise we might get wrong
+assumption which causes weird failures.
+
+--- cmocka-1.1.1.orig/include/cmocka.h
++++ cmocka-1.1.1/include/cmocka.h
+@@ -55,12 +55,9 @@
+ */
+
+ /* If __WORDSIZE is not set, try to figure it out and default to 32 bit. */
++#include <bits/reg.h>
+ #ifndef __WORDSIZE
+-# if defined(__x86_64__) && !defined(__ILP32__)
+-# define __WORDSIZE 64
+-# else
+-# define __WORDSIZE 32
+-# endif
++#error __WORDSIZE not defined
+ #endif
+
+ #ifdef DOXYGEN