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 810962 1e70fb2ab9ada8fa63993128920a0d4478113270
parent 810961 f7a3561127ac0f9cf1933862ce5e5fd8314407f5
child 810964 8ea0f47644c2ee1f4f5a9da237c8662c448b9141
push id114166
push userbmo:jacek@codeweavers.com
push dateTue, 26 Jun 2018 20:04:34 +0000
reviewersfroydnj
bugs1471177
milestone60.1.0
Bug 1471177 - Use mingw-specific IFStream and OFStream implementation only when building againstd libstdc++. r=froydnj MozReview-Commit-ID: 6aKGtK7B74z
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(); }