Permalink
Browse files

fix mingw build

  • Loading branch information...
1 parent 72b5976 commit fd9dbb1279bd09886bbb8c47df05255003eeffae Igor Zinkovsky committed Oct 13, 2011
Showing with 7 additions and 4 deletions.
  1. +7 −4 src/win/fs.c
View
@@ -40,6 +40,7 @@
#define UV_FS_CLEANEDUP 0x0010
#define UV_FS_LAST_ERROR_SET 0x0020
+
#define UTF8_TO_UTF16(s, t) \
size = uv_utf8_to_utf16(s, NULL, 0) * sizeof(wchar_t); \
t = (wchar_t*)malloc(size); \
@@ -400,10 +401,12 @@ void fs__readdir(uv_fs_t* req, const wchar_t* path, int flags) {
if (!path2) {
uv_fatal_error(ERROR_OUTOFMEMORY, "malloc");
}
-#pragma warning(push)
-#pragma warning(disable:4996)
- _swprintf(path2, fmt, path);
-#pragma warning(pop)
+
+#ifdef _MSC_VER
+ swprintf(path2, len + 3, fmt, path);
+#else
+ swprintf(path2, fmt, path);
+#endif
dir = FindFirstFileW(path2, &ent);
free(path2);

0 comments on commit fd9dbb1

Please sign in to comment.