Bug 1441558 Do not compile the Poison IO Interposer on MinGW r?froydnj draft
authorTom Ritter <tom@mozilla.com>
Tue, 20 Feb 2018 13:40:24 -0600
changeset 760436 faab34ee7c5a5820373fa54c7d137f0b84bee3b0
parent 760435 37cd9283849947b3114ba2f00aada73fabfb608b
push id100641
push userbmo:tom@mozilla.com
push dateTue, 27 Feb 2018 16:45:08 +0000
reviewersfroydnj
bugs1441558
milestone60.0a1
Bug 1441558 Do not compile the Poison IO Interposer on MinGW r?froydnj MozReview-Commit-ID: DNkqdZNuUfK
xpcom/build/PoisonIOInterposer.h
xpcom/build/moz.build
old mode 100644
new mode 100755
--- a/xpcom/build/PoisonIOInterposer.h
+++ b/xpcom/build/PoisonIOInterposer.h
@@ -31,17 +31,17 @@ void MozillaUnRegisterDebugHandle(intptr
 /** Unregister file descriptor from being ignored by poisoning IO interposer */
 void MozillaUnRegisterDebugFD(int aFd);
 
 /** Unregister file from being ignored by poisoning IO interposer */
 void MozillaUnRegisterDebugFILE(FILE* aFile);
 
 MOZ_END_EXTERN_C
 
-#if defined(XP_WIN) || defined(XP_MACOSX)
+#if defined(XP_MACOSX) || (defined(XP_WIN) && !defined(__MINGW32__))
 
 #ifdef __cplusplus
 namespace mozilla {
 
 /**
  * Check if a file is registered as a debug file.
  */
 bool IsDebugFile(intptr_t aFileID);
@@ -68,17 +68,17 @@ void OnlyReportDirtyWrites();
  * Clear IO poisoning, this is only safe to do on the main-thread when no other
  * threads are running.
  */
 void ClearPoisonIOInterposer();
 
 } // namespace mozilla
 #endif /* __cplusplus */
 
-#else /* XP_WIN || XP_MACOSX */
+#else /* defined(XP_MACOSX) || (defined(XP_WIN) && !defined(__MINGW32__)) */
 
 #ifdef __cplusplus
 namespace mozilla {
 inline bool IsDebugFile(intptr_t aFileID) { return true; }
 inline void InitPoisonIOInterposer() {}
 inline void ClearPoisonIOInterposer() {}
 #ifdef XP_MACOSX
 inline void OnlyReportDirtyWrites() {}
old mode 100644
new mode 100755
--- a/xpcom/build/moz.build
+++ b/xpcom/build/moz.build
@@ -23,21 +23,24 @@ EXPORTS.mozilla += [
     'PoisonIOInterposer.h',
     'XPCOM.h',
     'XREAppData.h',
 ]
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     EXPORTS += ['nsWindowsDllInterceptor.h']
     EXPORTS.mozilla += ['perfprobe.h']
-    SOURCES += [
-        'perfprobe.cpp',
-        'PoisonIOInterposerBase.cpp',
-        'PoisonIOInterposerWin.cpp',
-    ]
+    SOURCES += ['perfprobe.cpp']
+    if CONFIG['CC_TYPE'] != 'gcc':
+        SOURCES += [
+            'PoisonIOInterposerBase.cpp',
+            'PoisonIOInterposerWin.cpp',
+        ]
+    else:
+        SOURCES += ['PoisonIOInterposerStub.cpp']
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     UNIFIED_SOURCES += [
         'PoisonIOInterposerBase.cpp',
         'PoisonIOInterposerMac.cpp',
     ]
     SOURCES += ['mach_override.c']
     SOURCES['mach_override.c'].flags += ['-Wno-unused-function']
 else: