Bug 1100997 - Fixed FileUtilsWin.h compilation on mingw. r=cpearce
authorJacek Caban <jacek@codeweavers.com>
Thu, 20 Nov 2014 10:52:26 +0100
changeset 240936 1e4f975958f2ee83619a287e512f4e7f2abf1038
parent 240935 586cdaf7dd204d5b61d10a0b7353ab61b48cbb07
child 240937 62af62f4f0a4c8adef51fc3ae515f4a0dada764c
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1100997
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1100997 - Fixed FileUtilsWin.h compilation on mingw. r=cpearce
xpcom/io/FileUtilsWin.h
--- a/xpcom/io/FileUtilsWin.h
+++ b/xpcom/io/FileUtilsWin.h
@@ -16,29 +16,29 @@ namespace mozilla {
 
 inline bool
 EnsureLongPath(nsAString& aDosPath)
 {
   uint32_t aDosPathOriginalLen = aDosPath.Length();
   auto inputPath = PromiseFlatString(aDosPath);
   // Try to get the long path, or else get the required length of the long path
   DWORD longPathLen = GetLongPathNameW(inputPath.get(),
-                                       aDosPath.BeginWriting(),
+                                       reinterpret_cast<wchar_t*>(aDosPath.BeginWriting()),
                                        aDosPathOriginalLen);
   if (longPathLen == 0) {
     return false;
   }
   aDosPath.SetLength(longPathLen);
   if (longPathLen <= aDosPathOriginalLen) {
     // Our string happened to be long enough for the first call to succeed.
     return true;
   }
   // Now we have a large enough buffer, get the actual string
   longPathLen = GetLongPathNameW(inputPath.get(),
-                                 aDosPath.BeginWriting(), aDosPath.Length());
+                                 reinterpret_cast<wchar_t*>(aDosPath.BeginWriting()), aDosPath.Length());
   if (longPathLen == 0) {
     return false;
   }
   // This success check should always be less-than because longPathLen excludes
   // the null terminator on success, but includes it in the first call that
   // returned the required size.
   if (longPathLen < aDosPath.Length()) {
     aDosPath.SetLength(longPathLen);