diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index e2676fb7bd6d..fe8947f60975 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -829,11 +829,11 @@ void ContentChild::SetProcessName(const nsACString& aName, const nsACString* aCurrentProfile) { char* name; if ((name = PR_GetEnv("MOZ_DEBUG_APP_PROCESS")) && aName.EqualsASCII(name)) { -#ifdef OS_POSIX +#ifdef XP_UNIX printf_stderr("\n\nCHILDCHILDCHILDCHILD\n [%s] debug me @%d\n\n", name, getpid()); sleep(30); -#elif defined(OS_WIN) +#elif defined(XP_WIN) // Windows has a decent JIT debugging story, so NS_DebugBreak does the // right thing. NS_DebugBreak(NS_DEBUG_BREAK, @@ -1735,11 +1735,11 @@ mozilla::ipc::IPCResult ContentChild::RecvSetProcessSandbox( CrashReporter::AnnotateCrashReport( CrashReporter::Annotation::ContentSandboxEnabled, sandboxEnabled); -# if defined(XP_LINUX) && !defined(OS_ANDROID) +# if defined(XP_LINUX) && !defined(ANDROID) CrashReporter::AnnotateCrashReport( CrashReporter::Annotation::ContentSandboxCapabilities, static_cast(SandboxInfo::Get().AsInteger())); -# endif /* XP_LINUX && !OS_ANDROID */ +# endif /* XP_LINUX && !ANDROID */ #endif /* MOZ_SANDBOX */ return IPC_OK(); diff --git a/dom/ipc/ContentProcess.cpp b/dom/ipc/ContentProcess.cpp index 8761b258602b..54db9a7d9044 100644 --- a/dom/ipc/ContentProcess.cpp +++ b/dom/ipc/ContentProcess.cpp @@ -31,7 +31,7 @@ static nsresult GetGREDir(nsIFile** aResult) { nsresult rv = XRE_GetBinaryPath(getter_AddRefs(current)); NS_ENSURE_SUCCESS(rv, rv); -#ifdef OS_MACOSX +#ifdef XP_DARWIN // Walk out of [subprocess].app/Contents/MacOS to the real GRE dir const int depth = 4; #else @@ -47,7 +47,7 @@ static nsresult GetGREDir(nsIFile** aResult) { NS_ENSURE_TRUE(current, NS_ERROR_UNEXPECTED); } -#ifdef OS_MACOSX +#ifdef XP_DARWIN rv = current->SetNativeLeafName("Resources"_ns); NS_ENSURE_SUCCESS(rv, rv); #endif diff --git a/dom/media/gmp/GMPChild.cpp b/dom/media/gmp/GMPChild.cpp index 0d485345bc6d..99039998f68f 100644 --- a/dom/media/gmp/GMPChild.cpp +++ b/dom/media/gmp/GMPChild.cpp @@ -226,7 +226,7 @@ bool GMPChild::GetUTF8LibPath(nsACString& aOutLibPath) { #if defined(XP_MACOSX) nsAutoString binaryName = u"lib"_ns + baseName + u".dylib"_ns; -#elif defined(OS_POSIX) +#elif defined(XP_UNIX) nsAutoString binaryName = u"lib"_ns + baseName + u".so"_ns; #elif defined(XP_WIN) nsAutoString binaryName = baseName + u".dll"_ns; diff --git a/dom/media/gmp/GMPProcessChild.cpp b/dom/media/gmp/GMPProcessChild.cpp index 17c70079cb4a..2d673f27ba6e 100644 --- a/dom/media/gmp/GMPProcessChild.cpp +++ b/dom/media/gmp/GMPProcessChild.cpp @@ -19,14 +19,14 @@ GMPProcessChild::~GMPProcessChild() = default; bool GMPProcessChild::Init(int aArgc, char* aArgv[]) { nsAutoString pluginFilename; -#if defined(OS_POSIX) +#if defined(XP_UNIX) // NB: need to be very careful in ensuring that the first arg // (after the binary name) here is indeed the plugin module path. // Keep in sync with dom/plugins/PluginModuleParent. std::vector values = CommandLine::ForCurrentProcess()->argv(); MOZ_ASSERT(values.size() >= 2, "not enough args"); CopyUTF8toUTF16(nsDependentCString(values[1].c_str()), pluginFilename); -#elif defined(OS_WIN) +#elif defined(XP_WIN) std::vector values = CommandLine::ForCurrentProcess()->GetLooseValues(); MOZ_ASSERT(values.size() >= 1, "not enough loose args"); diff --git a/dom/media/ipc/RDDProcessImpl.cpp b/dom/media/ipc/RDDProcessImpl.cpp index 6ddd4ffe95b9..c49709e07275 100644 --- a/dom/media/ipc/RDDProcessImpl.cpp +++ b/dom/media/ipc/RDDProcessImpl.cpp @@ -8,7 +8,7 @@ #include "mozilla/ipc/IOThreadChild.h" #include "mozilla/GeckoArgs.h" -#if defined(OS_WIN) && defined(MOZ_SANDBOX) +#if defined(XP_WIN) && defined(MOZ_SANDBOX) # include "mozilla/sandboxTarget.h" #elif defined(__OpenBSD__) && defined(MOZ_SANDBOX) # include "mozilla/SandboxSettings.h" @@ -22,7 +22,7 @@ using namespace ipc; RDDProcessImpl::~RDDProcessImpl() = default; bool RDDProcessImpl::Init(int aArgc, char* aArgv[]) { -#if defined(MOZ_SANDBOX) && defined(OS_WIN) +#if defined(MOZ_SANDBOX) && defined(XP_WIN) // Preload AV dlls so we can enable Binary Signature Policy // to restrict further dll loads. LoadLibraryW(L"mozavcodec.dll"); diff --git a/dom/webauthn/PublicKeyCredential.cpp b/dom/webauthn/PublicKeyCredential.cpp index c81f859a53a9..7001a55184ff 100644 --- a/dom/webauthn/PublicKeyCredential.cpp +++ b/dom/webauthn/PublicKeyCredential.cpp @@ -12,7 +12,7 @@ #include "mozilla/HoldDropJSObjects.h" #include "mozilla/Preferences.h" -#ifdef OS_WIN +#ifdef XP_WIN # include "WinWebAuthnManager.h" #endif @@ -93,7 +93,7 @@ PublicKeyCredential::IsUserVerifyingPlatformAuthenticatorAvailable( // // If on latest windows, call system APIs, otherwise return false, as we don't // have other UVPAAs available at this time. -#ifdef OS_WIN +#ifdef XP_WIN if (WinWebAuthnManager::IsUserVerifyingPlatformAuthenticatorAvailable()) { promise->MaybeResolve(true); @@ -129,7 +129,7 @@ PublicKeyCredential::IsExternalCTAP2SecurityKeySupported(GlobalObject& aGlobal, return nullptr; } -#ifdef OS_WIN +#ifdef XP_WIN if (WinWebAuthnManager::AreWebAuthNApisAvailable()) { promise->MaybeResolve(true); } else { diff --git a/dom/webauthn/WebAuthnManager.cpp b/dom/webauthn/WebAuthnManager.cpp index 9a15f62bb447..215a5e69b39d 100644 --- a/dom/webauthn/WebAuthnManager.cpp +++ b/dom/webauthn/WebAuthnManager.cpp @@ -23,7 +23,7 @@ #include "mozilla/ipc/BackgroundChild.h" #include "mozilla/ipc/PBackgroundChild.h" -#ifdef OS_WIN +#ifdef XP_WIN # include "WinWebAuthnManager.h" #endif @@ -451,7 +451,7 @@ already_AddRefed WebAuthnManager::MakeCredential( adjustedTimeout, excludeList, rpInfo, userInfo, coseAlgos, extensions, authSelection, attestation, context->Top()->Id()); -#ifdef OS_WIN +#ifdef XP_WIN if (!WinWebAuthnManager::AreWebAuthNApisAvailable()) { ListenForVisibilityEvents(); } @@ -658,7 +658,7 @@ already_AddRefed WebAuthnManager::GetAssertion( extensions, aOptions.mUserVerification, context->Top()->Id()); -#ifdef OS_WIN +#ifdef XP_WIN if (!WinWebAuthnManager::AreWebAuthNApisAvailable()) { ListenForVisibilityEvents(); } diff --git a/dom/webauthn/WebAuthnTransactionParent.cpp b/dom/webauthn/WebAuthnTransactionParent.cpp index d73542d47884..48931846388f 100644 --- a/dom/webauthn/WebAuthnTransactionParent.cpp +++ b/dom/webauthn/WebAuthnTransactionParent.cpp @@ -13,7 +13,7 @@ #include "nsThreadUtils.h" -#ifdef OS_WIN +#ifdef XP_WIN # include "WinWebAuthnManager.h" #endif @@ -24,7 +24,7 @@ mozilla::ipc::IPCResult WebAuthnTransactionParent::RecvRequestRegister( const WebAuthnMakeCredentialInfo& aTransactionInfo) { ::mozilla::ipc::AssertIsOnBackgroundThread(); -#ifdef OS_WIN +#ifdef XP_WIN if (WinWebAuthnManager::AreWebAuthNApisAvailable()) { WinWebAuthnManager* mgr = WinWebAuthnManager::Get(); mgr->Register(this, aTransactionId, aTransactionInfo); @@ -51,7 +51,7 @@ mozilla::ipc::IPCResult WebAuthnTransactionParent::RecvRequestSign( const WebAuthnGetAssertionInfo& aTransactionInfo) { ::mozilla::ipc::AssertIsOnBackgroundThread(); -#ifdef OS_WIN +#ifdef XP_WIN if (WinWebAuthnManager::AreWebAuthNApisAvailable()) { WinWebAuthnManager* mgr = WinWebAuthnManager::Get(); mgr->Sign(this, aTransactionId, aTransactionInfo); @@ -77,7 +77,7 @@ mozilla::ipc::IPCResult WebAuthnTransactionParent::RecvRequestCancel( const Tainted& aTransactionId) { ::mozilla::ipc::AssertIsOnBackgroundThread(); -#ifdef OS_WIN +#ifdef XP_WIN if (WinWebAuthnManager::AreWebAuthNApisAvailable()) { WinWebAuthnManager* mgr = WinWebAuthnManager::Get(); mgr->Cancel(this, aTransactionId); @@ -124,7 +124,7 @@ void WebAuthnTransactionParent::ActorDestroy(ActorDestroyReason aWhy) { // Called either by Send__delete__() in RecvDestroyMe() above, or when // the channel disconnects. Ensure the token manager forgets about us. -#ifdef OS_WIN +#ifdef XP_WIN if (WinWebAuthnManager::AreWebAuthNApisAvailable()) { WinWebAuthnManager* mgr = WinWebAuthnManager::Get(); if (mgr) { diff --git a/gfx/ipc/GPUProcessImpl.cpp b/gfx/ipc/GPUProcessImpl.cpp index 00a5335ab6b5..3ea86843e0f5 100644 --- a/gfx/ipc/GPUProcessImpl.cpp +++ b/gfx/ipc/GPUProcessImpl.cpp @@ -9,7 +9,7 @@ #include "mozilla/ipc/ProcessUtils.h" #include "mozilla/GeckoArgs.h" -#if defined(OS_WIN) && defined(MOZ_SANDBOX) +#if defined(XP_WIN) && defined(MOZ_SANDBOX) # include "mozilla/sandboxTarget.h" #elif defined(__OpenBSD__) && defined(MOZ_SANDBOX) # include "mozilla/SandboxSettings.h" @@ -23,7 +23,7 @@ using namespace ipc; GPUProcessImpl::~GPUProcessImpl() = default; bool GPUProcessImpl::Init(int aArgc, char* aArgv[]) { -#if defined(MOZ_SANDBOX) && defined(OS_WIN) +#if defined(MOZ_SANDBOX) && defined(XP_WIN) mozilla::SandboxTarget::Instance()->StartSandbox(); #elif defined(__OpenBSD__) && defined(MOZ_SANDBOX) StartOpenBSDSandbox(GeckoProcessType_GPU); diff --git a/gfx/layers/ipc/ISurfaceAllocator.cpp b/gfx/layers/ipc/ISurfaceAllocator.cpp index 7baca7a9b667..46c8c6703a07 100644 --- a/gfx/layers/ipc/ISurfaceAllocator.cpp +++ b/gfx/layers/ipc/ISurfaceAllocator.cpp @@ -26,7 +26,7 @@ void HostIPCAllocator::SendPendingAsyncMessages() { // Some type of AsyncParentMessageData message could have // one file descriptor (e.g. OpDeliverFence). // A number of file descriptors per gecko ipc message have a limitation - // on OS_POSIX (MACOSX or LINUX). + // on XP_UNIX (MACOSX or LINUX). static const uint32_t kMaxMessageNumber = IPC::Message::MAX_DESCRIPTORS_PER_MESSAGE; diff --git a/gfx/layers/ipc/ImageBridgeParent.cpp b/gfx/layers/ipc/ImageBridgeParent.cpp index 4d20d763cec2..ee4d0ccc617e 100644 --- a/gfx/layers/ipc/ImageBridgeParent.cpp +++ b/gfx/layers/ipc/ImageBridgeParent.cpp @@ -35,7 +35,7 @@ #include "mozilla/layers/TextureHost.h" #include "nsThreadUtils.h" -#if defined(OS_WIN) +#if defined(XP_WIN) # include "mozilla/layers/TextureD3D11.h" #endif diff --git a/layout/build/nsLayoutStatics.cpp b/layout/build/nsLayoutStatics.cpp index 1b6f45818cdb..f44cacb558c9 100644 --- a/layout/build/nsLayoutStatics.cpp +++ b/layout/build/nsLayoutStatics.cpp @@ -107,7 +107,7 @@ #include "mozilla/dom/WebIDLGlobalNameHash.h" #include "mozilla/dom/U2FTokenManager.h" #include "mozilla/dom/WebAuthnController.h" -#ifdef OS_WIN +#ifdef XP_WIN # include "mozilla/dom/WinWebAuthnManager.h" #endif #include "mozilla/dom/PointerEventHandler.h" @@ -265,7 +265,7 @@ nsresult nsLayoutStatics::Initialize() { mozilla::dom::U2FTokenManager::Initialize(); mozilla::dom::WebAuthnController::Initialize(); -#ifdef OS_WIN +#ifdef XP_WIN mozilla::dom::WinWebAuthnManager::Initialize(); #endif diff --git a/netwerk/ipc/SocketProcessImpl.cpp b/netwerk/ipc/SocketProcessImpl.cpp index 40c64dc2bb73..a863d4a8759b 100644 --- a/netwerk/ipc/SocketProcessImpl.cpp +++ b/netwerk/ipc/SocketProcessImpl.cpp @@ -14,14 +14,14 @@ #include "mozilla/ipc/ProcessUtils.h" #include "mozilla/ipc/IOThreadChild.h" -#if defined(OS_WIN) && defined(MOZ_SANDBOX) +#if defined(XP_WIN) && defined(MOZ_SANDBOX) # include "mozilla/sandboxTarget.h" #elif defined(__OpenBSD__) && defined(MOZ_SANDBOX) # include "mozilla/SandboxSettings.h" # include "prlink.h" #endif -#ifdef OS_POSIX +#ifdef XP_UNIX # include // For sleep(). #endif @@ -35,14 +35,14 @@ LazyLogModule gSocketProcessLog("socketprocess"); SocketProcessImpl::~SocketProcessImpl() = default; bool SocketProcessImpl::Init(int aArgc, char* aArgv[]) { -#ifdef OS_POSIX +#ifdef XP_UNIX if (PR_GetEnv("MOZ_DEBUG_SOCKET_PROCESS")) { printf_stderr("\n\nSOCKETPROCESSnSOCKETPROCESS\n debug me @ %d\n\n", base::GetCurrentProcId()); sleep(30); } #endif -#if defined(MOZ_SANDBOX) && defined(OS_WIN) +#if defined(MOZ_SANDBOX) && defined(XP_WIN) LoadLibraryW(L"nss3.dll"); LoadLibraryW(L"softokn3.dll"); LoadLibraryW(L"freebl3.dll"); diff --git a/toolkit/crashreporter/google-breakpad/src/processor/proc_maps_linux.cc b/toolkit/crashreporter/google-breakpad/src/processor/proc_maps_linux.cc index 3c0dea25d218..a6f8953bc309 100644 --- a/toolkit/crashreporter/google-breakpad/src/processor/proc_maps_linux.cc +++ b/toolkit/crashreporter/google-breakpad/src/processor/proc_maps_linux.cc @@ -15,7 +15,7 @@ #include "common/using_std_string.h" #include "processor/logging.h" -#if defined(OS_ANDROID) && !defined(__LP64__) +#if defined(ANDROID) && !defined(__LP64__) // In 32-bit mode, Bionic's inttypes.h defines PRI/SCNxPTR as an // unsigned long int, which is incompatible with Bionic's stdint.h // defining uintptr_t as an unsigned int: diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index 9158d4f9b8ad..d74c0d3e6314 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -5925,7 +5925,7 @@ int XRE_main(int argc, char* argv[], const BootstrapConfig& aConfig) { nsresult XRE_InitCommandLine(int aArgc, char* aArgv[]) { nsresult rv = NS_OK; -#if defined(OS_WIN) +#if defined(XP_WIN) CommandLine::Init(aArgc, aArgv); #else diff --git a/toolkit/xre/nsEmbedFunctions.cpp b/toolkit/xre/nsEmbedFunctions.cpp index fa236e0f8623..aaafe2b8c63a 100644 --- a/toolkit/xre/nsEmbedFunctions.cpp +++ b/toolkit/xre/nsEmbedFunctions.cpp @@ -226,15 +226,15 @@ int GetDebugChildPauseTime() { if (pauseStr && *pauseStr) { int pause = atoi(pauseStr); if (pause != 1) { // must be !=1 since =1 enables the default pause time -#if defined(OS_WIN) +#if defined(XP_WIN) pause *= 1000; // convert to ms #endif return pause; } } -#ifdef OS_POSIX +#ifdef XP_UNIX return 30; // seconds -#elif defined(OS_WIN) +#elif defined(XP_WIN) return 10000; // milliseconds #else return 0; @@ -432,7 +432,7 @@ nsresult XRE_InitChildProcess(int aArgc, char* aArgv[], g_set_prgname(aArgv[0]); #endif -#ifdef OS_POSIX +#ifdef XP_UNIX if (PR_GetEnv("MOZ_DEBUG_CHILD_PROCESS") || PR_GetEnv("MOZ_DEBUG_CHILD_PAUSE")) { # if defined(XP_LINUX) && defined(DEBUG) @@ -445,7 +445,7 @@ nsresult XRE_InitChildProcess(int aArgc, char* aArgv[], XRE_GetProcessTypeString(), base::GetCurrentProcId()); sleep(GetDebugChildPauseTime()); } -#elif defined(OS_WIN) +#elif defined(XP_WIN) if (PR_GetEnv("MOZ_DEBUG_CHILD_PROCESS")) { NS_DebugBreak(NS_DEBUG_BREAK, "Invoking NS_DebugBreak() to debug child process", nullptr, diff --git a/widget/InputData.cpp b/widget/InputData.cpp index 0265aab5a815..fdff81821e2b 100644 --- a/widget/InputData.cpp +++ b/widget/InputData.cpp @@ -608,7 +608,7 @@ WidgetWheelEvent PinchGestureInput::ToWidgetEvent(nsIWidget* aWidget) const { } double PinchGestureInput::ComputeDeltaY(nsIWidget* aWidget) const { -#if defined(OS_MACOSX) +#if defined(XP_DARWIN) // This converts the pinch gesture value to a fake wheel event that has the // control key pressed so that pages can implement custom pinch gesture // handling. It may seem strange that this doesn't use a wheel event with diff --git a/xpcom/base/Logging.cpp b/xpcom/base/Logging.cpp index 44f74686a90b..fa1527346561 100644 --- a/xpcom/base/Logging.cpp +++ b/xpcom/base/Logging.cpp @@ -199,7 +199,7 @@ bool LimitFileToLessThanSize(const char* aFilename, uint32_t aSize, ScopedCloseFile temp; -#if defined(OS_WIN) +#if defined(XP_WIN) // This approach was cribbed from // https://searchfox.org/mozilla-central/rev/868935867c6241e1302e64cf9be8f56db0fd0d1c/xpcom/build/LateWriteChecks.cpp#158. HANDLE hFile; @@ -222,7 +222,7 @@ bool LimitFileToLessThanSize(const char* aFilename, uint32_t aSize, } temp.reset(_fdopen(fd, "ab")); -#elif defined(OS_POSIX) +#elif defined(XP_UNIX) // Coverity would prefer us to set a secure umask before using `mkstemp`. // However, the umask is process-wide, so setting it may lead to difficult @@ -273,13 +273,13 @@ bool LimitFileToLessThanSize(const char* aFilename, uint32_t aSize, return false; } -#if defined(OS_WIN) +#if defined(XP_WIN) if (!::ReplaceFileA(aFilename, tempFilename, nullptr, 0, 0, 0)) { NS_WARNING( nsPrintfCString("ReplaceFileA failed: %lu\n", GetLastError()).get()); return false; } -#elif defined(OS_POSIX) +#elif defined(XP_UNIX) if (rename(tempFilename, aFilename)) { NS_WARNING( nsPrintfCString("rename failed: %s (%d)\n", strerror(errno), errno) diff --git a/xpcom/build/XPCOMInit.cpp b/xpcom/build/XPCOMInit.cpp index cd6c7f705289..96d6b44c1f2b 100644 --- a/xpcom/build/XPCOMInit.cpp +++ b/xpcom/build/XPCOMInit.cpp @@ -359,7 +359,7 @@ NS_InitXPCOM(nsIServiceManager** aResult, nsIFile* aBinDirectory, } if ((sCommandLineWasInitialized = !CommandLine::IsInitialized())) { -#ifdef OS_WIN +#ifdef XP_WIN CommandLine::Init(0, nullptr); #else nsCOMPtr binaryFile;