Skip to content

Commit ddf485c

Browse files
authored
Merge pull request RustPython#3265 from youknowone/wasi
Fix wasi build
2 parents 6adf14b + 8515779 commit ddf485c

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

vm/src/stdlib/errno.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,36 +59,37 @@ const ERROR_CODES: &[(&str, i32)] = &[
5959
cfg(not(any(
6060
target_os = "openbsd",
6161
target_os = "freebsd",
62+
target_os = "wasi",
6263
windows
6364
))),
6465
ENODATA
6566
),
66-
e!(cfg(not(windows)), ENOTBLK),
67+
e!(cfg(not(any(windows, target_os = "wasi"))), ENOTBLK),
6768
e!(EOPNOTSUPP),
6869
e!(ENOSYS),
6970
e!(EPIPE),
7071
e!(EINVAL),
7172
e!(cfg(not(windows)), EOVERFLOW),
7273
e!(EINTR),
73-
e!(EUSERS),
74+
e!(cfg(not(target_os = "wasi")), EUSERS),
7475
e!(ENOTEMPTY),
7576
e!(ENOBUFS),
7677
e!(cfg(not(windows)), EPROTO),
77-
e!(EREMOTE),
78+
e!(cfg(not(target_os = "wasi")), EREMOTE),
7879
e!(ECHILD),
7980
e!(ELOOP),
8081
e!(EXDEV),
8182
e!(E2BIG),
8283
e!(ESRCH),
8384
e!(EMSGSIZE),
8485
e!(EAFNOSUPPORT),
85-
e!(EHOSTDOWN),
86-
e!(EPFNOSUPPORT),
86+
e!(cfg(not(target_os = "wasi")), EHOSTDOWN),
87+
e!(cfg(not(target_os = "wasi")), EPFNOSUPPORT),
8788
e!(ENOPROTOOPT),
8889
e!(EBUSY),
8990
e!(EAGAIN),
9091
e!(EISCONN),
91-
e!(ESHUTDOWN),
92+
e!(cfg(not(target_os = "wasi")), ESHUTDOWN),
9293
e!(EBADF),
9394
e!(cfg(not(any(target_os = "openbsd", windows))), EMULTIHOP),
9495
e!(EIO),
@@ -121,6 +122,7 @@ const ERROR_CODES: &[(&str, i32)] = &[
121122
cfg(not(any(
122123
target_os = "openbsd",
123124
target_os = "freebsd",
125+
target_os = "wasi",
124126
windows
125127
))),
126128
ENOSTR
@@ -137,6 +139,7 @@ const ERROR_CODES: &[(&str, i32)] = &[
137139
cfg(not(any(
138140
target_os = "openbsd",
139141
target_os = "freebsd",
142+
target_os = "wasi",
140143
windows
141144
))),
142145
ENOSR
@@ -150,16 +153,17 @@ const ERROR_CODES: &[(&str, i32)] = &[
150153
e!(cfg(not(any(target_os = "redox", windows))), ENOTSUP),
151154
e!(ENAMETOOLONG),
152155
e!(ENOTTY),
153-
e!(ESOCKTNOSUPPORT),
156+
e!(cfg(not(target_os = "wasi")), ESOCKTNOSUPPORT),
154157
e!(
155158
cfg(not(any(
156159
target_os = "openbsd",
157160
target_os = "freebsd",
161+
target_os = "wasi",
158162
windows
159163
))),
160164
ETIME
161165
),
162-
e!(ETOOMANYREFS),
166+
e!(cfg(not(target_os = "wasi")), ETOOMANYREFS),
163167
e!(EMFILE),
164168
e!(cfg(not(windows)), ETXTBSY),
165169
e!(EINPROGRESS),

0 commit comments

Comments
 (0)