Unverified Commit ad87e243 authored by Kenton Varda's avatar Kenton Varda Committed by GitHub

Merge pull request #809 from capnproto/jlee/fix-mingw-warnings

Jlee/fix mingw warnings
parents f35bd896 ba5e63b3
......@@ -189,17 +189,6 @@ int win32Socketpair(SOCKET socks[2]) {
namespace {
bool detectWine() {
HMODULE hntdll = GetModuleHandle("ntdll.dll");
if(hntdll == NULL) return false;
return GetProcAddress(hntdll, "wine_get_version") != nullptr;
}
bool isWine() {
static bool result = detectWine();
return result;
}
// =======================================================================================
static constexpr uint NEW_FD_FLAGS = LowLevelAsyncIoProvider::TAKE_OWNERSHIP;
......
......@@ -30,9 +30,11 @@ namespace {
TEST(Exception, TrimSourceFilename) {
#if _WIN32
if (trimSourceFilename(__FILE__) != "kj\\exception-test.c++")
#endif
EXPECT_TRUE(trimSourceFilename(__FILE__) == "kj/exception-test.c++" ||
trimSourceFilename(__FILE__) == "kj\\exception-test.c++");
#else
EXPECT_EQ(trimSourceFilename(__FILE__), "kj/exception-test.c++");
#endif
}
TEST(Exception, RunCatchingExceptions) {
......
......@@ -22,6 +22,12 @@
#if _WIN32
// For Unix implementation, see filesystem-disk-unix.c++.
// Request Vista-level APIs.
#define WINVER 0x0600
#define _WIN32_WINNT 0x0600
#define WIN32_LEAN_AND_MEAN // ::eyeroll::
#include "filesystem.h"
#include "debug.h"
#include "encoding.h"
......@@ -29,12 +35,6 @@
#include <algorithm>
#include <wchar.h>
// Request Vista-level APIs.
#define WINVER 0x0600
#define _WIN32_WINNT 0x0600
#define WIN32_LEAN_AND_MEAN // ::eyeroll::
#include <windows.h>
#include <winioctl.h>
#include "windows-sanity.h"
......@@ -869,6 +869,7 @@ public:
// Retry, but make sure we don't try to create the parent again.
return tryReplaceNode(path, mode - WriteMode::CREATE_PARENT, kj::mv(tryCreate));
}
// fallthrough
default:
KJ_FAIL_WIN32("create(path)", error, path) { return false; }
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment