From 94a04ead81e8ed877eb890b306a0e39947f5094d Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <uwe.korn@quantco.com>
Date: Tue, 11 May 2021 15:09:51 +0200
Subject: [PATCH 7/8] Only error on undefined TARGET_OS_OSX

---
 clang/lib/Driver/ToolChains/Darwin.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp
index f7da3f187814..4efe81614f81 100644
--- a/clang/lib/Driver/ToolChains/Darwin.cpp
+++ b/clang/lib/Driver/ToolChains/Darwin.cpp
@@ -1042,7 +1042,7 @@ DarwinClang::DarwinClang(const Driver &D, const llvm::Triple &Triple,
 
 void DarwinClang::addClangWarningOptions(ArgStringList &CC1Args) const {
   // Always error about undefined 'TARGET_OS_*' macros.
-  CC1Args.push_back("-Wundef-prefix=TARGET_OS_");
+  CC1Args.push_back("-Wundef-prefix=TARGET_OS_OSX");
   CC1Args.push_back("-Werror=undef-prefix");
 
   // For modern targets, promote certain warnings to errors.
-- 
2.35.3.windows.1

