diff --git a/src/lib_c/x86_64-windows-msvc/c/stdarg.cr b/src/lib_c/x86_64-windows-msvc/c/stdarg.cr new file mode 100644 index 000000000000..882d4f51d35c --- /dev/null +++ b/src/lib_c/x86_64-windows-msvc/c/stdarg.cr @@ -0,0 +1,3 @@ +lib LibC + type VaList = Void* +end diff --git a/src/lib_c/x86_64-windows-msvc/c/stdio.cr b/src/lib_c/x86_64-windows-msvc/c/stdio.cr index 3c6dfb7a60ef..b9c57ae4133e 100644 --- a/src/lib_c/x86_64-windows-msvc/c/stdio.cr +++ b/src/lib_c/x86_64-windows-msvc/c/stdio.cr @@ -3,5 +3,12 @@ require "./stddef" lib LibC fun printf(format : Char*, ...) : Int fun rename(old : Char*, new : Char*) : Int - fun snprintf(s : Char*, maxlen : SizeT, format : Char*, ...) : Int + fun vsnprintf(str : Char*, size : SizeT, format : Char*, ap : VaList) : Int + fun snprintf = __crystal_snprintf(str : Char*, size : SizeT, format : Char*, ...) : Int +end + +fun __crystal_snprintf(str : LibC::Char*, size : LibC::SizeT, format : LibC::Char*, ...) : LibC::Int + VaList.open do |varargs| + LibC.vsnprintf(str, size, format, varargs) + end end