File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -575,11 +575,19 @@ pub mod intrinsics {
575575}
576576
577577pub mod libc {
578+ // With the new Universal CRT, msvc has switched to all the printf functions being inline wrapper
579+ // functions. legacy_stdio_definitions.lib which provides the printf wrapper functions as normal
580+ // symbols to link against.
581+ #[ cfg_attr( unix, link( name = "c" ) ) ]
582+ #[ cfg_attr( target_env="msvc" , link( name="legacy_stdio_definitions" ) ) ]
583+ extern "C" {
584+ pub fn printf ( format : * const i8 , ...) -> i32 ;
585+ }
586+
578587 #[ cfg_attr( unix, link( name = "c" ) ) ]
579588 #[ cfg_attr( target_env = "msvc" , link( name = "msvcrt" ) ) ]
580589 extern "C" {
581590 pub fn puts ( s : * const i8 ) -> i32 ;
582- pub fn printf ( format : * const i8 , ...) -> i32 ;
583591 pub fn malloc ( size : usize ) -> * mut u8 ;
584592 pub fn free ( ptr : * mut u8 ) ;
585593 pub fn memcpy ( dst : * mut u8 , src : * const u8 , size : usize ) ;
You can’t perform that action at this time.
0 commit comments