Skip to content

Commit

Permalink
Bug 1431803 Turn __try into if(true) and __except into else in the ch…
Browse files Browse the repository at this point in the history
…romium sandbox code r=bobowen,glandium

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. So
we do that to neuter them in all places. There is only one situation where
we need to actively modify the code (because it always throws an exception)
and that situation is resolved in the other patch of this bug.

MozReview-Commit-ID: IySnfxDlmW3
  • Loading branch information
tomrittervg committed Jan 22, 2018
1 parent cbccde4 commit 49db7aa
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion mozilla-config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@
*/
#if defined(CHROMIUM_SANDBOX_BUILD) && defined(XP_WIN)
#include "base/win/sdkdecls.h"
#endif

#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 */

0 comments on commit 49db7aa

Please sign in to comment.