summaryrefslogtreecommitdiffstats
path: root/external/cairo/pixman/pixman-wasm.patch
diff options
context:
space:
mode:
Diffstat (limited to 'external/cairo/pixman/pixman-wasm.patch')
-rw-r--r--external/cairo/pixman/pixman-wasm.patch108
1 files changed, 108 insertions, 0 deletions
diff --git a/external/cairo/pixman/pixman-wasm.patch b/external/cairo/pixman/pixman-wasm.patch
new file mode 100644
index 0000000000..a04aa7ccca
--- /dev/null
+++ b/external/cairo/pixman/pixman-wasm.patch
@@ -0,0 +1,108 @@
+--- a/pixman/pixman/pixman-x86.c
++++ b/pixman/pixman/pixman-x86.c
+@@ -77,13 +77,20 @@
+
+ #else
+
+-#define _PIXMAN_X86_64 \
+- (defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64))
++#if (defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64))
++#define _PIXMAN_X86_64 1
++#else
++#define _PIXMAN_X86_64 0
++#endif
+
+ static pixman_bool_t
+ have_cpuid (void)
+ {
+-#if _PIXMAN_X86_64 || defined (_MSC_VER)
++#if defined(__EMSCRIPTEN__)
++
++ return FALSE;
++
++#elif _PIXMAN_X86_64 || defined (_MSC_VER)
+
+ return TRUE;
+
+@@ -109,6 +109,8 @@
+ #endif
+ }
+
++#if !defined(__EMSCRIPTEN__)
++
+ static void
+ pixman_cpuid (uint32_t feature,
+ uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d)
+@@ -156,10 +156,17 @@
+ #error Unknown compiler
+ #endif
+ }
++
++#endif // !__EMSCRIPTEN__
+
+ static cpu_features_t
+ detect_cpu_features (void)
+ {
++#if defined(__EMSCRIPTEN__)
++
++ return X86_MMX | X86_MMX_EXTENSIONS | X86_SSE | X86_SSE2 | X86_SSSE3;
++
++#else
+ uint32_t a, b, c, d;
+ cpu_features_t features = 0;
+
+@@ -202,6 +202,8 @@
+ }
+
+ return features;
++
++#endif // !__EMSCRIPTEN__
+ }
+
+ #endif
+--- a/pixman/pixman/pixman-ssse3.c
++++ b/pixman/pixman/pixman-ssse3.c
+@@ -28,7 +28,9 @@
+ #endif
+
+ #include <stdlib.h>
++#if !defined(__EMSCRIPTEN__)
+ #include <mmintrin.h>
++#endif
+ #include <xmmintrin.h>
+ #include <emmintrin.h>
+ #include <tmmintrin.h>
+--- a/pixman/configure
++++ b/pixman/configure
+@@ -14207,7 +14207,11 @@
+ #if defined(__GNUC__) && (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4))
+ #error "Need GCC >= 3.4 for MMX intrinsics"
+ #endif
++#if !defined(__EMSCRIPTEN__)
+ #include <mmintrin.h>
++#else
++#include <xmmintrin.h>
++#endif
+ #include <stdint.h>
+
+ /* Check support for block expressions */
+@@ -14308,7 +14308,9 @@
+ # error "Need GCC >= 4.2 for SSE2 intrinsics on x86"
+ # endif
+ #endif
++#if !defined(__EMSCRIPTEN__)
+ #include <mmintrin.h>
++#endif
+ #include <xmmintrin.h>
+ #include <emmintrin.h>
+ int param;
+@@ -14380,7 +14380,9 @@
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
++#if !defined(__EMSCRIPTEN__)
+ #include <mmintrin.h>
++#endif
+ #include <xmmintrin.h>
+ #include <emmintrin.h>
+ #include <tmmintrin.h>