Bug 1100997 - Fixed FileUtilsWin.h compilation on mingw. r=cpearce
authorJacek Caban <jacek@codeweavers.com>
Thu, 20 Nov 2014 10:52:26 +0100
changeset 216622 1e4f975958f2ee83619a287e512f4e7f2abf1038
parent 216621 586cdaf7dd204d5b61d10a0b7353ab61b48cbb07
child 216623 62af62f4f0a4c8adef51fc3ae515f4a0dada764c
push idunknown
push userunknown
push dateunknown
reviewerscpearce
bugs1100997
milestone36.0a1
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);