]> git.mxchange.org Git - simgear.git/commitdiff
Fixed compilation errors with MSVC++
authorBertrand Coconnier <bcoconni@users.sourceforge.net>
Sun, 3 Jul 2016 09:53:23 +0000 (11:53 +0200)
committerRoland Haeder <roland@mxchange.org>
Sat, 13 Aug 2016 08:21:16 +0000 (10:21 +0200)
simgear/misc/sg_dir.cxx
simgear/misc/sg_path.cxx

index 18a018edf270406c677eb867957e1324d9f658f7..18f14b19021a4897af69d1e648d487b6899bc4d6 100644 (file)
@@ -32,6 +32,7 @@
 #  define WIN32_LEAN_AND_MEAN
 #  include <windows.h>
 #  include <direct.h>
+#  include <Shlwapi.h>
 #else
 #  include <sys/types.h>
 #  include <dirent.h>
index 2ae206a05e5b469e62c5d76b1cb7c12cb6711707..7c37d705ba3ebc49f734814e81e16991d1f9907d 100644 (file)
@@ -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();
 }
-