@@ -37,7 +37,10 @@ pub mod posix;
3737#[ path = "posix_compat.rs" ]
3838pub mod posix;
3939
40- #[ cfg( any( target_family = "unix" , target_family = "windows" ) ) ]
40+ #[ cfg( all(
41+ any( target_os = "linux" , target_os = "macos" , target_os = "windows" ) ,
42+ not( any( target_env = "musl" , target_env = "sgx" ) )
43+ ) ) ]
4144mod ctypes;
4245#[ cfg( windows) ]
4346pub ( crate ) mod msvcrt;
@@ -73,62 +76,65 @@ pub fn get_module_inits() -> StdlibMap {
7376 } } ;
7477 }
7578 modules ! {
76- #[ cfg( all( ) ) ]
77- {
78- "atexit" => atexit:: make_module,
79- "_codecs" => codecs:: make_module,
80- "_collections" => collections:: make_module,
81- "errno" => errno:: make_module,
82- "_functools" => functools:: make_module,
83- "itertools" => itertools:: make_module,
84- "_io" => io:: make_module,
85- "marshal" => marshal:: make_module,
86- "_operator" => operator:: make_module,
87- "_signal" => signal:: make_module,
88- "_sre" => sre:: make_module,
89- "_string" => string:: make_module,
90- "time" => time:: make_module,
91- "_typing" => typing:: make_module,
92- "_weakref" => weakref:: make_module,
93- "_imp" => imp:: make_module,
94- "_warnings" => warnings:: make_module,
95- sys:: sysconfigdata_name( ) => sysconfigdata:: make_module,
96- }
97- // parser related modules:
98- #[ cfg( feature = "rustpython-ast" ) ]
99- {
100- "_ast" => ast:: make_module,
101- }
102- // compiler related modules:
103- #[ cfg( feature = "rustpython-compiler" ) ]
104- {
105- "symtable" => symtable:: make_module,
106- }
107- #[ cfg( any( unix, target_os = "wasi" ) ) ]
108- {
109- "posix" => posix:: make_module,
110- // "fcntl" => fcntl::make_module,
111- }
112- #[ cfg( feature = "threading" ) ]
113- {
114- "_thread" => thread:: make_module,
115- }
116- // Unix-only
117- #[ cfg( all( unix, not( any( target_os = "android" , target_os = "redox" ) ) ) ) ]
118- {
119- "pwd" => pwd:: make_module,
120- }
121- // Windows-only
122- #[ cfg( windows) ]
123- {
124- "nt" => nt:: make_module,
125- "msvcrt" => msvcrt:: make_module,
126- "_winapi" => winapi:: make_module,
127- "winreg" => winreg:: make_module,
128- }
129- #[ cfg( any( target_family = "unix" , target_family = "windows" ) ) ]
130- {
131- "_ctypes" => ctypes:: make_module,
132- }
79+ #[ cfg( all( ) ) ]
80+ {
81+ "atexit" => atexit:: make_module,
82+ "_codecs" => codecs:: make_module,
83+ "_collections" => collections:: make_module,
84+ "errno" => errno:: make_module,
85+ "_functools" => functools:: make_module,
86+ "itertools" => itertools:: make_module,
87+ "_io" => io:: make_module,
88+ "marshal" => marshal:: make_module,
89+ "_operator" => operator:: make_module,
90+ "_signal" => signal:: make_module,
91+ "_sre" => sre:: make_module,
92+ "_string" => string:: make_module,
93+ "time" => time:: make_module,
94+ "_typing" => typing:: make_module,
95+ "_weakref" => weakref:: make_module,
96+ "_imp" => imp:: make_module,
97+ "_warnings" => warnings:: make_module,
98+ sys:: sysconfigdata_name( ) => sysconfigdata:: make_module,
99+ }
100+ // parser related modules:
101+ #[ cfg( feature = "rustpython-ast" ) ]
102+ {
103+ "_ast" => ast:: make_module,
104+ }
105+ // compiler related modules:
106+ #[ cfg( feature = "rustpython-compiler" ) ]
107+ {
108+ "symtable" => symtable:: make_module,
109+ }
110+ #[ cfg( any( unix, target_os = "wasi" ) ) ]
111+ {
112+ "posix" => posix:: make_module,
113+ // "fcntl" => fcntl::make_module,
114+ }
115+ #[ cfg( feature = "threading" ) ]
116+ {
117+ "_thread" => thread:: make_module,
118+ }
119+ // Unix-only
120+ #[ cfg( all( unix, not( any( target_os = "android" , target_os = "redox" ) ) ) ) ]
121+ {
122+ "pwd" => pwd:: make_module,
123+ }
124+ // Windows-only
125+ #[ cfg( windows) ]
126+ {
127+ "nt" => nt:: make_module,
128+ "msvcrt" => msvcrt:: make_module,
129+ "_winapi" => winapi:: make_module,
130+ "winreg" => winreg:: make_module,
131+ }
132+ #[ cfg( all(
133+ any( target_os = "linux" , target_os = "macos" , target_os = "windows" ) ,
134+ not( any( target_env = "musl" , target_env = "sgx" ) )
135+ ) ) ]
136+ {
137+ "_ctypes" => ctypes:: make_module,
138+ }
133139 }
134140}
0 commit comments