File tree 3 files changed +599
-8
lines changed
3 files changed +599
-8
lines changed Original file line number Diff line number Diff line change @@ -1875,17 +1875,28 @@ fn test_wasi(target: &str) {
1875
1875
cfg. define ( "_GNU_SOURCE" , None ) ;
1876
1876
1877
1877
headers ! { cfg:
1878
+ "ctype.h" ,
1879
+ "dirent.h" ,
1878
1880
"errno.h" ,
1879
1881
"fcntl.h" ,
1880
1882
"limits.h" ,
1881
1883
"locale.h" ,
1882
1884
"malloc.h" ,
1885
+ "poll.h" ,
1886
+ "stdbool.h" ,
1883
1887
"stddef.h" ,
1884
1888
"stdint.h" ,
1885
1889
"stdio.h" ,
1886
1890
"stdlib.h" ,
1891
+ "string.h" ,
1892
+ "sys/resource.h" ,
1893
+ "sys/select.h" ,
1894
+ "sys/socket.h" ,
1887
1895
"sys/stat.h" ,
1896
+ "sys/times.h" ,
1888
1897
"sys/types.h" ,
1898
+ "sys/uio.h" ,
1899
+ "sys/utsname.h" ,
1889
1900
"time.h" ,
1890
1901
"unistd.h" ,
1891
1902
"wasi/core.h" ,
@@ -1895,7 +1906,7 @@ fn test_wasi(target: &str) {
1895
1906
}
1896
1907
1897
1908
cfg. type_name ( move |ty, is_struct, is_union| match ty {
1898
- "FILE" => ty. to_string ( ) ,
1909
+ "FILE" | "fd_set" | "DIR" => ty. to_string ( ) ,
1899
1910
t if is_union => format ! ( "union {}" , t) ,
1900
1911
t if t. starts_with ( "__wasi" ) && t. ends_with ( "_u" ) => {
1901
1912
format ! ( "union {}" , t)
@@ -1920,5 +1931,9 @@ fn test_wasi(target: &str) {
1920
1931
// import the same thing but have different function pointers
1921
1932
cfg. skip_fn_ptrcheck ( |f| f. starts_with ( "__wasi" ) ) ;
1922
1933
1934
+ // d_name is declared as a flexible array in WASI libc, so it
1935
+ // doesn't support sizeof.
1936
+ cfg. skip_field ( |s, field| s == "dirent" && field == "d_name" ) ;
1937
+
1923
1938
cfg. generate ( "../src/lib.rs" , "main.rs" ) ;
1924
1939
}
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ cfg_if! {
112
112
} else if #[ cfg( all( target_env = "sgx" , target_vendor = "fortanix" ) ) ] {
113
113
mod sgx;
114
114
pub use sgx:: * ;
115
- } else if #[ cfg( target_env = "wasi" ) ] {
115
+ } else if #[ cfg( any ( target_env = "wasi" , target_os = "wasi" ) ) ] {
116
116
mod wasi;
117
117
pub use wasi:: * ;
118
118
} else {
You can’t perform that action at this time.
0 commit comments