Bug 1471177 - Use mingw-specific IFStream and OFStream implementation only when building againstd libstdc++. r?froydnj draft
authorJacek Caban <jacek@codeweavers.com>
Tue, 26 Jun 2018 13:06:17 +0200
changeset 810739 70b718b34a5105fd250f36350b10ee2be6dc9c16
parent 810712 ca98b6f47b4e33673291a4dc2a4ebca28ce6db00
child 810872 3c594cca8c20006879fad5227d9837da33888808
push id114081
push userbmo:jacek@codeweavers.com
push dateTue, 26 Jun 2018 11:20:55 +0000
reviewersfroydnj
bugs1471177
milestone63.0a1
Bug 1471177 - Use mingw-specific IFStream and OFStream implementation only when building againstd libstdc++. r?froydnj
mfbt/FStream.h
--- a/mfbt/FStream.h
+++ b/mfbt/FStream.h
@@ -13,25 +13,25 @@
 
 #ifndef mozilla_FStream_h
 #define mozilla_FStream_h
 
 #include "mozilla/Char16.h"
 #include <istream>
 #include <ostream>
 #include <fstream>
-#if defined(__MINGW32__)
+#if defined(__MINGW32__) && defined(____GLIBCXX__)
 #include "mozilla/UniquePtr.h"
 #include <fcntl.h>
 #include <ext/stdio_filebuf.h>
 #endif
 
 namespace mozilla {
 
-#if defined(__MINGW32__)
+#if defined(__MINGW32__) && defined(__GLIBCXX__)
 // MinGW does not support wchar_t* overloads that are MSVC extension until
 // C++17, so we have to implement widechar wrappers using a GNU extension.
 class IFStream : public std::istream
 {
 public:
   explicit IFStream(char16ptr_t filename, openmode mode = in);
 
   std::filebuf* rdbuf() const { return mFileBuf.get(); }