Skip to content

Commit 3b3d762

Browse files
Dan Gohmanjohn-sharratt
authored andcommitted
Don't define _POSIX_THREADS unless threads are enabled. (WebAssembly#356)
* Don't define `_POSIX_THREADS` unless threads are enabled. Fixes WebAssembly#355. * Remove `_POSIX_THREADS` from predefined-macros.txt.
1 parent 70d101a commit 3b3d762

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

expected/wasm32-wasi/single/predefined-macros.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5125,7 +5125,6 @@
51255125
#define _POSIX_STREAM_MAX 8
51265126
#define _POSIX_SYMLINK_MAX 255
51275127
#define _POSIX_SYMLOOP_MAX 8
5128-
#define _POSIX_THREADS _POSIX_VERSION
51295128
#define _POSIX_THREAD_ATTR_STACKADDR _POSIX_VERSION
51305129
#define _POSIX_THREAD_ATTR_STACKSIZE _POSIX_VERSION
51315130
#define _POSIX_THREAD_CPUTIME _POSIX_VERSION

libc-top-half/musl/include/unistd.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,9 @@ pid_t gettid(void);
316316
#endif
317317
#define _POSIX_VDISABLE 0
318318

319+
#if defined(__wasilibc_unmodified_upstream) || defined(_REENTRANT)
319320
#define _POSIX_THREADS _POSIX_VERSION
321+
#endif
320322
#define _POSIX_THREAD_PROCESS_SHARED _POSIX_VERSION
321323
#define _POSIX_THREAD_SAFE_FUNCTIONS _POSIX_VERSION
322324
#define _POSIX_THREAD_ATTR_STACKADDR _POSIX_VERSION

0 commit comments

Comments
 (0)