Blob Blame History Raw
diff -rupN libkml-1.3.0/src/kml/base/file_win32.cc libkml-1.3.0-new/src/kml/base/file_win32.cc
--- libkml-1.3.0/src/kml/base/file_win32.cc	2015-12-21 18:23:05.000000000 +0100
+++ libkml-1.3.0-new/src/kml/base/file_win32.cc	2017-10-30 11:45:08.434800533 +0100
@@ -34,7 +34,6 @@
 #include "kml/base/file.h"
 #include <windows.h>
 #include <tchar.h>
-#include <xstring>
 #include <algorithm>
 
 namespace kmlbase {
@@ -42,7 +41,7 @@ namespace kmlbase {
 // Internal to the win32 file class. We need a conversion from string to
 // LPCWSTR.
 static std::wstring Str2Wstr(const string& str) {
-  std::wstring wstr(str.length(), L'');
+  std::wstring wstr(str.length(), '\0');
   std::copy(str.begin(), str.end(), wstr.begin());
   return wstr;
 }
@@ -62,7 +61,7 @@ bool File::Exists(const string& full_pat
     return false;
   }
   std::wstring wstr = Str2Wstr(full_path);
-  DWORD attrs = ::GetFileAttributes(wstr.c_str());
+  DWORD attrs = ::GetFileAttributesW(wstr.c_str());
   return (attrs != INVALID_FILE_ATTRIBUTES) &&
     ((attrs & FILE_ATTRIBUTE_DIRECTORY) == 0);
 }
@@ -72,7 +71,7 @@ bool File::Delete(const string& filepath
     return false;
   }
   std::wstring wstr = Str2Wstr(filepath);
-  return ::DeleteFile(wstr.c_str()) ? true : false;
+  return ::DeleteFileW(wstr.c_str()) ? true : false;
 }
 
 static const unsigned int BUFSIZE = 1024;
@@ -97,7 +96,7 @@ bool File::CreateNewTempFile(string* pat
   if (uRetVal == 0) {
     return false;
   }
-  string str = Wstr2Str(szTempName);
+  string str = szTempName;
   path->assign(str.c_str(), strlen(str.c_str()));
   return true;
 }