Browse Source

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.
pull/357/head
Dan Gohman 2 years ago
committed by GitHub
parent
commit
7250bd4165
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      expected/wasm32-wasi/single/predefined-macros.txt
  2. 2
      libc-top-half/musl/include/unistd.h

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

@ -2123,7 +2123,6 @@
#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

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

@ -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

Loading…
Cancel
Save