fix: guard O_SYNC flag with ifdef and add mingw32 libuv link libs

Guard the O_SYNC flag usage in mapFileFlags() with a preprocessor
conditional to fix compilation on Windows where this constant is not
defined. Additionally, add the required Windows socket and system
libraries (ws2_32, iphlpapi, psapi, userenv) to LIBUV_LIBS when
building under mingw32, replacing the Linux-specific pthread and rt
libraries.
This commit is contained in:
Yasuhiro Matsumoto
2016-03-08 13:05:39 +00:00
parent 5d42ce9ad6
commit d15981644a
2 changed files with 6 additions and 0 deletions
+2
View File
@@ -194,7 +194,9 @@ static int mapFileFlags(int flags)
if (flags & 0x01) result |= O_RDONLY;
if (flags & 0x02) result |= O_WRONLY;
if (flags & 0x04) result |= O_RDWR;
#ifdef O_SYNC
if (flags & 0x08) result |= O_SYNC;
#endif
if (flags & 0x10) result |= O_CREAT;
if (flags & 0x20) result |= O_TRUNC;
if (flags & 0x40) result |= O_EXCL;