diff --git a/clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp b/clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp index 7864fb76d160d8..bdc3895162898b 100644 --- a/clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp +++ b/clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp @@ -14,10 +14,13 @@ #include "llvm/Support/Error.h" #include "llvm/Support/Path.h" #include +#include using namespace llvm; using namespace clang; +#if TARGET_OS_OSX + static void stopFSEventStream(FSEventStreamRef); namespace { @@ -249,3 +252,17 @@ llvm::Expected> clang::DirectoryWatcher::creat return Result; } + +#else // TARGET_OS_OSX + +llvm::Expected> +clang::DirectoryWatcher::create( + StringRef Path, + std::function, bool)> Receiver, + bool WaitForInitialSync) { + return llvm::make_error( + "DirectoryWatcher is not implemented for this platform!", + llvm::inconvertibleErrorCode()); +} + +#endif // TARGET_OS_OSX