Commit cfa475f
feat: add partial support for WASI
This change allows building the `cmark-gfm` target for both `wasm32-unknown-wasi` and `wasm32-unknown-wasip1-threads`. The other targets are not tested.
The differences between two target triples:
- `wasm32-unknown-wasi`
- C
- can import `unistd.h`
- has `__wasi__`
- does not have `__unix__`
- **does not have `_REENTRANT`**
- **does not have `_POSIX_THREADS`**
- **does not support pthreads API at all**
- Swift
- can use `#if os(WASI)`
- SwiftPM
- `BuildSettingsCondition`'s `Platform` is `.wasi`
- `wasm32-unknown-wasip1-threads`
- C
- can import `unistd.h`
- has `__wasi__`
- does not have `__unix__`
- **has `_REENTRANT` (defined in wasi-libc)**
- **has `_POSIX_THREADS` (defined in wasi-libc)**
- **supports a subset of pthreads API**
- Swift
- can use `#if os(WASI)`
- SwiftPM
- `BuildSettingsCondition`'s `Platform` is `.wasi`1 parent b97d094 commit cfa475f
3 files changed
+10
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | | - | |
18 | | - | |
19 | | - | |
| 16 | + | |
20 | 17 | | |
21 | 18 | | |
22 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
6 | 12 | | |
7 | 13 | | |
8 | | - | |
| 14 | + | |
9 | 15 | | |
10 | 16 | | |
11 | 17 | | |
| |||
0 commit comments