windows: check for nonconforming swprintf arguments

Newer versions of mingw do include the correct API for swprintf.
Check for _CRT_NON_CONFORMING_SWPRINTFS as specified in the swprintf
documentation:
http://msdn.microsoft.com/en-us/library/ybk95axf(v=vs.90).aspx
This commit is contained in:
Brent Cook 2013-08-31 04:52:31 -05:00 committed by Ben Noordhuis
parent f3f23b2d05
commit fe3a11e09f

View File

@ -715,10 +715,10 @@ void fs__readdir(uv_fs_t* req) {
uv_fatal_error(ERROR_OUTOFMEMORY, "malloc");
}
#ifdef _MSC_VER
swprintf(path2, len + 3, fmt, pathw);
#else
#ifdef _CRT_NON_CONFORMING_SWPRINTFS
swprintf(path2, fmt, pathw);
#else
swprintf(path2, len + 3, fmt, pathw);
#endif
dir = FindFirstFileW(path2, &ent);
free(path2);