Skip to content

Commit 7250bd4

Browse files
authoredDec 7, 2022
Don't define _POSIX_THREADS unless threads are enabled. (#356)
* Don't define `_POSIX_THREADS` unless threads are enabled. Fixes #355. * Remove `_POSIX_THREADS` from predefined-macros.txt.
1 parent f32e258 commit 7250bd4

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
 

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

-1
Original file line numberDiff line numberDiff line change
@@ -2123,7 +2123,6 @@
21232123
#define _POSIX_STREAM_MAX 8
21242124
#define _POSIX_SYMLINK_MAX 255
21252125
#define _POSIX_SYMLOOP_MAX 8
2126-
#define _POSIX_THREADS _POSIX_VERSION
21272126
#define _POSIX_THREAD_ATTR_STACKADDR _POSIX_VERSION
21282127
#define _POSIX_THREAD_ATTR_STACKSIZE _POSIX_VERSION
21292128
#define _POSIX_THREAD_CPUTIME _POSIX_VERSION

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

+2
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,9 @@ pid_t gettid(void);
336336
#endif
337337
#define _POSIX_VDISABLE 0
338338

339+
#if defined(__wasilibc_unmodified_upstream) || defined(_REENTRANT)
339340
#define _POSIX_THREADS _POSIX_VERSION
341+
#endif
340342
#define _POSIX_THREAD_PROCESS_SHARED _POSIX_VERSION
341343
#define _POSIX_THREAD_SAFE_FUNCTIONS _POSIX_VERSION
342344
#define _POSIX_THREAD_ATTR_STACKADDR _POSIX_VERSION

0 commit comments

Comments
 (0)
Please sign in to comment.