From f43e786cf17be2630dcdd7ed8fe9e2a506fbcfab Mon Sep 17 00:00:00 2001 From: Daniel Kroening Date: Sun, 31 Mar 2019 16:58:00 +0100 Subject: [PATCH] fix compilation with cygwin The variant of std::ifstream with a wide character file name is only available when using Visual Studio but not when using Cygwin. --- src/goto-cc/cl_message_handler.cpp | 2 +- src/goto-cc/gcc_message_handler.cpp | 2 +- unit/util/file_util.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/goto-cc/cl_message_handler.cpp b/src/goto-cc/cl_message_handler.cpp index 89f596059a2..a871aeeeb6d 100644 --- a/src/goto-cc/cl_message_handler.cpp +++ b/src/goto-cc/cl_message_handler.cpp @@ -42,7 +42,7 @@ void cl_message_handlert::print( if(full_path.has_value() && !line.empty()) { -#ifdef _WIN32 +#ifdef _MSC_VER std::ifstream in(widen(full_path.value())); #else std::ifstream in(full_path.value()); diff --git a/src/goto-cc/gcc_message_handler.cpp b/src/goto-cc/gcc_message_handler.cpp index 12386ff572f..77a82f0afd8 100644 --- a/src/goto-cc/gcc_message_handler.cpp +++ b/src/goto-cc/gcc_message_handler.cpp @@ -66,7 +66,7 @@ void gcc_message_handlert::print( const auto file_name = location.full_path(); if(file_name.has_value() && !line.empty()) { -#ifdef _WIN32 +#ifdef _MSC_VER std::ifstream in(widen(file_name.value())); #else std::ifstream in(file_name.value()); diff --git a/unit/util/file_util.cpp b/unit/util/file_util.cpp index 102ad69ce3e..c9d72494c03 100644 --- a/unit/util/file_util.cpp +++ b/unit/util/file_util.cpp @@ -40,7 +40,7 @@ TEST_CASE("is_directory functionality", "[core][util][file_util]") { temp_dirt temp_dir("testXXXXXX"); -#ifdef _WIN32 +#ifdef _MSC_VER std::ofstream outfile(widen(temp_dir("file"))); #else std::ofstream outfile(temp_dir("file"));