From 70bbfa0e00d45e2b007c9a98515fbd0c11ea9642 Mon Sep 17 00:00:00 2001 From: Stefano Cristiano Date: Mon, 15 Jun 2015 12:03:42 +0200 Subject: [PATCH] win,fs: Fixes align(8) directive on mingw MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: https://github.com/libuv/libuv/issues/190 PR-URL: https://github.com/libuv/libuv/pull/398 Reviewed-By: Saúl Ibarra Corretgé --- src/win/fs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/win/fs.c b/src/win/fs.c index 88d0ff5c..e837d5de 100644 --- a/src/win/fs.c +++ b/src/win/fs.c @@ -825,7 +825,11 @@ void fs__scandir(uv_fs_t* req) { * A file name is at most 256 WCHARs long. * According to MSDN, the buffer must be aligned at an 8-byte boundary. */ +#if _MSC_VER __declspec(align(8)) char buffer[8192]; +#else + __attribute__ ((aligned (8))) char buffer[8192]; +#endif STATIC_ASSERT(sizeof buffer >= sizeof(FILE_DIRECTORY_INFORMATION) + 256 * sizeof(WCHAR));