From 784697ff1d1e14feb33baa658b4c21db4b5a0ada Mon Sep 17 00:00:00 2001 From: Bertrand Coconnier Date: Sun, 3 Jul 2016 11:53:23 +0200 Subject: [PATCH] Fixed compilation errors with MSVC++ --- simgear/misc/sg_dir.cxx | 1 + simgear/misc/sg_path.cxx | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/simgear/misc/sg_dir.cxx b/simgear/misc/sg_dir.cxx index 18a018ed..18f14b19 100644 --- a/simgear/misc/sg_dir.cxx +++ b/simgear/misc/sg_dir.cxx @@ -32,6 +32,7 @@ # define WIN32_LEAN_AND_MEAN # include # include +# include #else # include # include diff --git a/simgear/misc/sg_path.cxx b/simgear/misc/sg_path.cxx index 2ae206a0..7c37d705 100644 --- a/simgear/misc/sg_path.cxx +++ b/simgear/misc/sg_path.cxx @@ -988,7 +988,7 @@ std::wstring SGPath::wstr() const { #ifdef SG_WINDOWS size_t buflen = mbstowcs(NULL, path.c_str(), 0)+1; - wchar_t wideBuf = malloc(buflen * sizeof(int)); + wchar_t* wideBuf = malloc(buflen * sizeof(int)); if (wideBuf) { size_t count = mbstowcs(wideBuf, path.c_str(), buflen); if (count == (size_t)-1) { @@ -1002,5 +1002,5 @@ std::wstring SGPath::wstr() const SG_LOG( SG_GENERAL, SG_ALERT, "SGPath::wstr: unable to allocate enough memory for " << *this ); } #endif + return std::wstring(); } - -- 2.39.2