Daniel Green avatar Daniel Green committed 344229e

Use alias to make vswprintf and swprintf match ANSI signature.

Comments (0)

Files changed (1)

d/druntime/core/stdc/wchar_.d

 
 int fwprintf(FILE* stream, in wchar_t* format, ...);
 int fwscanf(FILE* stream, in wchar_t* format, ...);
-int swprintf(wchar_t* s, size_t n, in wchar_t* format, ...);
 int swscanf(in wchar_t* s, in wchar_t* format, ...);
 int vfwprintf(FILE* stream, in wchar_t* format, va_list arg);
 int vfwscanf(FILE* stream, in wchar_t* format, va_list arg);
-int vswprintf(wchar_t* s, size_t n, in wchar_t* format, va_list arg);
 int vswscanf(in wchar_t* s, in wchar_t* format, va_list arg);
 int vwprintf(in wchar_t* format, va_list arg);
 int vwscanf(in wchar_t* format, va_list arg);
 int wprintf(in wchar_t* format, ...);
 int wscanf(in wchar_t* format, ...);
 
+/*
+ * Windows has 2 versions of swprintf and vswprintf.  MinGW defaults to the
+ * Microsoft signature.  Alias to match DMD/ANSI signature.
+ */
+version( MinGW )
+{
+	int _snwprintf(wchar_t* s, size_t n, in wchar_t* format, ...);
+	alias _snwprintf swprintf;
+
+	int _vsnwprintf(wchar_t* s, size_t n, in wchar_t* format, va_list arg);
+	alias _vsnwprintf vswprintf;	
+}
+else
+{
+	int swprintf(wchar_t* s, size_t n, in wchar_t* format, ...);
+	int vswprintf(wchar_t* s, size_t n, in wchar_t* format, va_list arg);
+}
+
+
 wint_t fgetwc(FILE* stream);
 wint_t fputwc(wchar_t c, FILE* stream);
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.