From 87c9598c97edd87213393964909eb14b513bf732 Mon Sep 17 00:00:00 2001 From: casey langen Date: Sat, 5 Jan 2019 13:23:47 -0800 Subject: [PATCH] Fixed win32 compile. --- src/plugins/gmedecoder/Constants.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/plugins/gmedecoder/Constants.h b/src/plugins/gmedecoder/Constants.h index 09e43af9a..dff79d7a5 100644 --- a/src/plugins/gmedecoder/Constants.h +++ b/src/plugins/gmedecoder/Constants.h @@ -198,7 +198,17 @@ static int getLastModifiedTime(const std::string& fn) { static inline std::string canonicalizePath(const std::string& path) { #ifdef WIN32 - http://msdn.microsoft.com/en-us/library/aa364963%28v=VS.85%29.aspx + std::wstring path16 = u8to16(path.c_str()); + std::string result8; + DWORD size = GetFullPathName(path16.c_str(), 0, 0, nullptr); + if (size) { + wchar_t* dest = new wchar_t[size]; + if (GetFullPathName(path16.c_str(), size, dest, nullptr)) { + result8 = u16to8(dest); + } + delete[] dest; + } + return result8; #else char realname[_POSIX_PATH_MAX]; if (realpath(path.c_str(), realname) == 0) {