From 2838f6e239cbefa68e900e55760e20660f5fa73e Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Mon, 7 Nov 2016 11:03:31 +0100 Subject: [PATCH] added (maybe) missed header --- src/uvw/loop.hpp | 8 ++++---- test/uvw/fs.cpp | 15 ++++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/uvw/loop.hpp b/src/uvw/loop.hpp index c1d8e485..445a14dc 100644 --- a/src/uvw/loop.hpp +++ b/src/uvw/loop.hpp @@ -1,9 +1,5 @@ #pragma once -#ifdef _WIN32 -#include -#endif - #include #include #include @@ -12,6 +8,10 @@ #include #include "emitter.hpp" +#ifdef _WIN32 +#include +#endif + namespace uvw { diff --git a/test/uvw/fs.cpp b/test/uvw/fs.cpp index 8092a546..d3e1415f 100644 --- a/test/uvw/fs.cpp +++ b/test/uvw/fs.cpp @@ -1,6 +1,10 @@ #include #include +#ifdef _WIN32 +#include +#endif + TEST(FileReq, OpenAndClose) { const std::string filename = std::string{TARGET_FS_DIR} + std::string{"/test.fs"}; @@ -22,13 +26,11 @@ TEST(FileReq, OpenAndClose) { }); #ifdef _WIN32 - auto flags = _O_RDWR | _O_CREAT; + request->open(filename, _O_RDWR | _O_CREAT, 0644); #else - auto flags = O_RDWR | O_CREAT; + request->open(filename, O_RDWR | O_CREAT, 0644); #endif - request->open(filename, flags, 0644); - loop->run(); ASSERT_FALSE(checkErrorEvent); @@ -43,12 +45,11 @@ TEST(FileReq, OpenAndCloseSync) { auto request = loop->resource(); #ifdef _WIN32 - auto flags = _O_RDWR | _O_CREAT; + ASSERT_TRUE(request->openSync(filename, _O_RDWR | _O_CREAT, 0644)); #else - auto flags = O_RDWR | O_CREAT; + ASSERT_TRUE(request->openSync(filename, O_RDWR | O_CREAT, 0644)); #endif - ASSERT_TRUE(request->openSync(filename, flags, 0644)); ASSERT_TRUE(request->closeSync()); loop->run();