]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
mythread.h: Disable signal functions in builds targeting Wasm + WASI.
authorChanTsune <41658782+ChanTsune@users.noreply.github.com>
Tue, 1 Aug 2023 15:17:17 +0000 (18:17 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Tue, 1 Aug 2023 15:18:05 +0000 (18:18 +0300)
signal.h in WASI SDK doesn't currently provide sigprocmask()
or sigset_t. liblzma doesn't need them so this change makes
liblzma and xzdec build against WASI SDK. xz doesn't build yet
and the tests don't either as tuktest needs setjmp() which
isn't (yet?) implemented in WASI SDK.

Closes: https://github.com/tukaani-project/xz/pull/57
See also: https://github.com/tukaani-project/xz/pull/56

(The original commit was edited a little by Lasse Collin.)

src/common/mythread.h

index 7a80f966e31f8e4bbc0651b2a641de7b4283308a..1cce50e9fd857908bfc536ea2160f26cf0c8b8a7 100644 (file)
@@ -79,7 +79,7 @@ do { \
 } while (0)
 
 
-#if !(defined(_WIN32) && !defined(__CYGWIN__))
+#if !(defined(_WIN32) && !defined(__CYGWIN__)) && !defined(__wasm__)
 // Use sigprocmask() to set the signal mask in single-threaded programs.
 #include <signal.h>