diff options
author | Jake Petroules <jake.petroules@qt.io> | 2017-10-13 13:55:23 +0200 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2017-10-16 13:30:33 +0000 |
commit | 3116ae45c230a9e0cd4ca3d3abaf4a961e34cb04 (patch) | |
tree | 809788ede9c8f497966cc1c94d41a1d2c0bde0a8 | |
parent | b4b1ad197c919416beed1dd6d218d12f6867f58b (diff) |
Fix the build with MinGW
codecvt is an internal MSVC header which is included by the standard C++
header "locale", and stdlibc++ prior to GCC 5 is missing functionality
from locale.
In any case, we'll assume stdlibc++ on Windows takes care of encoding
issues, even if it doesn't.
Change-Id: I6667af9737510c6b8ffa80325b84279d36b781e3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r-- | src/lib/corelib/tools/iosutils.h | 4 | ||||
-rw-r--r-- | src/plugins/generator/visualstudio/visualstudioguidpool.cpp | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/corelib/tools/iosutils.h b/src/lib/corelib/tools/iosutils.h index 3cf3666d2..f165573f8 100644 --- a/src/lib/corelib/tools/iosutils.h +++ b/src/lib/corelib/tools/iosutils.h @@ -43,7 +43,7 @@ #include <cstdio> #include <ostream> -#if defined(_WIN32) +#if defined(_WIN32) && defined(_MSC_VER) #include <codecvt> #include <locale> #define QBS_RENAME_IMPL ::_wrename @@ -75,7 +75,7 @@ static inline bool fwrite(const char *s, std::ostream *stream) static inline qbs_filesystem_path_string_type utf8_to_native_path(const std::string &str) { -#if defined(_WIN32) +#if defined(_WIN32) && defined(_MSC_VER) std::wstring_convert<std::codecvt_utf8<wchar_t>> converter; return converter.from_bytes(str); #else diff --git a/src/plugins/generator/visualstudio/visualstudioguidpool.cpp b/src/plugins/generator/visualstudio/visualstudioguidpool.cpp index 780735fcb..d6d716ff2 100644 --- a/src/plugins/generator/visualstudio/visualstudioguidpool.cpp +++ b/src/plugins/generator/visualstudio/visualstudioguidpool.cpp @@ -30,6 +30,7 @@ #include "visualstudioguidpool.h" #include <tools/filesaver.h> +#include <tools/iosutils.h> #include <QtCore/quuid.h> #include <fstream> @@ -53,7 +54,7 @@ VisualStudioGuidPool::VisualStudioGuidPool(const std::string &storeFilePath) : d(std::make_shared<VisualStudioGuidPoolPrivate>()) { // Read any existing GUIDs from the on-disk store - std::ifstream file(d->storeFilePath = storeFilePath); + std::ifstream file(Internal::utf8_to_native_path(d->storeFilePath = storeFilePath)); if (file.is_open()) { const auto data = JsonDocument::fromJson(std::string { std::istreambuf_iterator<std::ifstream::char_type>(file), |