[clang] 122afae - [libclang][Cygwin] Use __declspec(dllexport) for libclang on Cygwin (#147122)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 7 12:55:56 PDT 2025
Author: Tomohiro Kashiwada
Date: 2025-07-07T22:55:53+03:00
New Revision: 122afae10ed28564b64530de571ce8e4ce584b2c
URL: https://github.com/llvm/llvm-project/commit/122afae10ed28564b64530de571ce8e4ce584b2c
DIFF: https://github.com/llvm/llvm-project/commit/122afae10ed28564b64530de571ce8e4ce584b2c.diff
LOG: [libclang][Cygwin] Use __declspec(dllexport) for libclang on Cygwin (#147122)
This is needed for Cygwin build without `-DLLVM_LINK_LLVM_DYLIB=ON`,
otherwise causes a linker error 'export ordinal too large'.
Added:
Modified:
clang/include/clang-c/Platform.h
Removed:
################################################################################
diff --git a/clang/include/clang-c/Platform.h b/clang/include/clang-c/Platform.h
index 67c1fff8ff783..8d341ddd6f8eb 100644
--- a/clang/include/clang-c/Platform.h
+++ b/clang/include/clang-c/Platform.h
@@ -22,7 +22,7 @@ LLVM_CLANG_C_EXTERN_C_BEGIN
#ifndef CINDEX_NO_EXPORTS
#define CINDEX_EXPORTS
#endif
-#ifdef _WIN32
+#if defined(_WIN32) || defined(__CYGWIN__)
#ifdef CINDEX_EXPORTS
#ifdef _CINDEX_LIB_
#define CINDEX_LINKAGE __declspec(dllexport)
More information about the cfe-commits
mailing list