Bug 1504022 - Restore mingw overrides for __try/__except (backout of 1498676) r=bobowen
authorTom Ritter <tom@mozilla.com>
Fri, 02 Nov 2018 13:07:29 -0500
changeset 444779 c2efa1db3727593d393e2d970ca0f39b0caab844
parent 444778 a701975a4509041ef1fe781a8bd8c6a1428dadd1
child 444780 52a1404ac742b76a5776c41aabc7f9d295e3a08a
push id35002
push userncsoregi@mozilla.com
push dateWed, 07 Nov 2018 09:53:22 +0000
treeherdermozilla-central@070757a0160c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbobowen
bugs1504022, 1498676
milestone65.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 1504022 - Restore mingw overrides for __try/__except (backout of 1498676) r=bobowen mingw-clang, when using SEH exceptions, compile these fine but don't unwind them properly. When using sj/lj exceptions it can't compile them at all.
mozilla-config.h.in
--- a/mozilla-config.h.in
+++ b/mozilla-config.h.in
@@ -40,11 +40,22 @@
 /*
  * Force-include sdkdecls.h for building the chromium sandbox code.
  *
  * CHROMIUM_SANDBOX_BUILD is defined in security/sandbox/moz.build.
  * Note that this include path relies on the LOCAL_INCLUDES in that file.
  */
 #if defined(CHROMIUM_SANDBOX_BUILD) && defined(XP_WIN)
 #include "base/win/sdkdecls.h"
+
+#ifdef __MINGW32__
+/*
+ * MinGW doesn't support __try / __except. There are a few mechanisms available
+ * to hack around it and pseudo-support it, but these are untested in Firefox.
+ * What is tested (and works) is replacing them with if(true) and else.
+ */
+#define __try if(true)
+#define __except(x) else
+
+#endif /* __MINGW32__ */
 #endif /* defined(CHROMIUM_SANDBOX_BUILD) && defined(XP_WIN) */
 
 #endif /* MOZILLA_CONFIG_H */