]> git.proxmox.com Git - wasi-libc.git/commitdiff
Don't define `_POSIX_THREADS` unless threads are enabled. (#356)
authorDan Gohman <dev@sunfishcode.online>
Wed, 7 Dec 2022 21:54:19 +0000 (13:54 -0800)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 2 Aug 2023 10:24:08 +0000 (12:24 +0200)
* Don't define `_POSIX_THREADS` unless threads are enabled.

Fixes #355.

* Remove `_POSIX_THREADS` from predefined-macros.txt.

expected/wasm32-wasi/single/predefined-macros.txt
libc-top-half/musl/include/unistd.h

index 1f7b341c765750f73162a6b32e8a395a94ba07b4..55fb278a69fd011c3e1840eac765a9791619facf 100644 (file)
 #define _POSIX_STREAM_MAX 8
 #define _POSIX_SYMLINK_MAX 255
 #define _POSIX_SYMLOOP_MAX 8
-#define _POSIX_THREADS _POSIX_VERSION
 #define _POSIX_THREAD_ATTR_STACKADDR _POSIX_VERSION
 #define _POSIX_THREAD_ATTR_STACKSIZE _POSIX_VERSION
 #define _POSIX_THREAD_CPUTIME _POSIX_VERSION
index b5cb5c6630169415c4e155c6d57cc7b943910d16..0be83e368c4c87224fb8a9b39808e3f642c948a9 100644 (file)
@@ -336,7 +336,9 @@ pid_t gettid(void);
 #endif
 #define _POSIX_VDISABLE         0
 
+#if defined(__wasilibc_unmodified_upstream) || defined(_REENTRANT)
 #define _POSIX_THREADS          _POSIX_VERSION
+#endif
 #define _POSIX_THREAD_PROCESS_SHARED _POSIX_VERSION
 #define _POSIX_THREAD_SAFE_FUNCTIONS _POSIX_VERSION
 #define _POSIX_THREAD_ATTR_STACKADDR _POSIX_VERSION