From 92638e543b56e4f5c740b024cc442fe354ef9334 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 4 Mar 2025 14:28:52 +0100 Subject: [PATCH] clover: Fix MSVC build Guard the include of dlfcn.h with HAVE_DLFCN_H. Use the FALLBACK_CLANG_RESOURCE_DIR if it is not available. Part-of: --- src/gallium/frontends/clover/llvm/invocation.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp index ca030b404d7..ccec22fb621 100644 --- a/src/gallium/frontends/clover/llvm/invocation.cpp +++ b/src/gallium/frontends/clover/llvm/invocation.cpp @@ -24,7 +24,9 @@ // OTHER DEALINGS IN THE SOFTWARE. // +#ifdef HAVE_DLFCN_H #include +#endif #include #include @@ -328,6 +330,7 @@ namespace { } std::string getResourceDirectory() { +#ifdef HAVE_DLFCN_H Dl_info info; if (dladdr((void *)clang::CompilerInvocation::CreateFromArgs, &info) == 0) { return FALLBACK_CLANG_RESOURCE_DIR; @@ -349,6 +352,9 @@ namespace { free(libclang_path); return clang_resource_dir; +#else + return FALLBACK_CLANG_RESOURCE_DIR; +#endif } std::unique_ptr