From fb1195cf88268a11e2709b9912ab9dca8c23739c Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 2 Apr 2023 03:24:39 +0000 Subject: [PATCH] build: respect autotools `DLL_EXPORT` in `libssh2.h` The `DLL_EXPORT` macro is automatically set by autotools when building the libssh2 DLL. Certain toolchains might require this to correctly export symbols, so make sure to respect it in `libssh2.h` to enable `declspec(dllexport)`. With this patch we have a manual macro for that (`LIBSSH2_EXPORT`), this autotools one, the CMake one, and `_WINDLL` (added in c355d31ff94a1622526c4988b9d09074f7f7605d), possibly defined by Visual Studio. Closes #917 --- include/libssh2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/libssh2.h b/include/libssh2.h index abc9f3b5..7d9b3397 100644 --- a/include/libssh2.h +++ b/include/libssh2.h @@ -100,7 +100,7 @@ extern "C" { /* Allow alternate API prefix from CFLAGS or calling app */ #ifndef LIBSSH2_API # ifdef WIN32 -# if defined(LIBSSH2_EXPORTS) || \ +# if defined(LIBSSH2_EXPORTS) || defined(DLL_EXPORT) || \ defined(_WINDLL) || defined(libssh2_shared_EXPORTS) # ifdef LIBSSH2_LIBRARY # define LIBSSH2_API __declspec(dllexport)