Bug 1648453 - Fix build errors caused by MacOS headers defining check macro r=smaug

These patches have triggered a case where a MacOS header defines 'check' as a macro which then conflicts with use of 'check' as a method name in AccessCheck.h, probably due to unified builds.

This was fixed independently in a couple of places before, but I think it makes sense to move the fix to AccessCheck.h itself.

Differential Revision: https://phabricator.services.mozilla.com/D83796
This commit is contained in:
Jon Coppeard 2020-07-17 17:36:04 +00:00
parent 1d1648a98c
commit 3cd1ede76a
3 changed files with 7 additions and 13 deletions

View File

@ -235,6 +235,7 @@
#include "mozilla/dom/U2F.h"
#include "mozilla/dom/WebIDLGlobalNameHash.h"
#include "mozilla/dom/Worklet.h"
#include "AccessCheck.h"
#ifdef HAVE_SIDEBAR
# include "mozilla/dom/ExternalBinding.h"
@ -244,13 +245,6 @@
# include "mozilla/dom/SpeechSynthesis.h"
#endif
// Apple system headers seem to have a check() macro. <sigh>
#ifdef check
class nsIScriptTimeoutHandler;
# undef check
#endif // check
#include "AccessCheck.h"
#ifdef ANDROID
# include <android/log.h>
#endif

View File

@ -64,13 +64,7 @@
#include "mozilla/CycleCollectedJSRuntime.h"
#include "nsRefreshDriver.h"
#include "nsJSPrincipals.h"
#ifdef XP_MACOSX
// AssertMacros.h defines 'check' and conflicts with AccessCheck.h
# undef check
#endif
#include "AccessCheck.h"
#include "mozilla/Logging.h"
#include "prthread.h"

View File

@ -11,6 +11,12 @@
#include "js/Wrapper.h"
#include "nsString.h"
#ifdef XP_MACOSX
// AssertMacros.h defines 'check' which conflicts with the method declarations
// in this file.
# undef check
#endif
namespace xpc {
class AccessCheck {