File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -72,12 +72,18 @@ mod imp {
7272 // acquire this mutex reentrantly!
7373 static LOCK : Mutex = Mutex :: new ( ) ;
7474
75- pub unsafe fn init ( argc : isize , argv : * const * const u8 ) {
75+ unsafe fn really_init ( argc : isize , argv : * const * const u8 ) {
7676 let _guard = LOCK . lock ( ) ;
7777 ARGC = argc;
7878 ARGV = argv;
7979 }
8080
81+ #[ inline( always) ]
82+ pub unsafe fn init ( _argc : isize , _argv : * const * const u8 ) {
83+ #[ cfg( not( all( target_os = "linux" , target_env = "gnu" ) ) ) ]
84+ really_init ( _argc, _argv) ;
85+ }
86+
8187 /// glibc passes argc, argv, and envp to functions in .init_array, as a non-standard extension.
8288 /// This allows `std::env::args` to work even in a `cdylib`, as it does on macOS and Windows.
8389 #[ cfg( all( target_os = "linux" , target_env = "gnu" ) ) ]
@@ -94,7 +100,7 @@ mod imp {
94100 _envp : * const * const u8 ,
95101 ) {
96102 unsafe {
97- init ( argc as isize , argv) ;
103+ really_init ( argc as isize , argv) ;
98104 }
99105 }
100106 init_wrapper
You can’t perform that action at this time.
0 commit comments