--- a/clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp	2021-10-26 12:21:35.000000000 +0100
+++ b/clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp	2021-10-26 12:25:47.000000000 +0100
@@ -19,6 +19,10 @@
 using namespace llvm;
 using namespace clang;
 
+#ifndef TARGET_OS_OSX
+# define TARGET_OS_OSX 1
+#endif
+
 #if TARGET_OS_OSX
 
 static void stopFSEventStream(FSEventStreamRef);
