diff --git a/include/libssh2.h b/include/libssh2.h index 322aa5ef..565bf060 100644 --- a/include/libssh2.h +++ b/include/libssh2.h @@ -100,11 +100,15 @@ extern "C" { /* Allow alternate API prefix from CFLAGS or calling app */ #ifndef LIBSSH2_API # ifdef LIBSSH2_WIN32 -# ifdef LIBSSH2_LIBRARY -# define LIBSSH2_API __declspec(dllexport) +# ifdef _WINDLL +# ifdef LIBSSH2_LIBRARY +# define LIBSSH2_API __declspec(dllexport) +# else +# define LIBSSH2_API __declspec(dllimport) +# endif /* LIBSSH2_LIBRARY */ # else -# define LIBSSH2_API __declspec(dllimport) -# endif /* LIBSSH2_LIBRARY */ +# define LIBSSH2_API +# endif # else /* !LIBSSH2_WIN32 */ # define LIBSSH2_API # endif /* LIBSSH2_WIN32 */