1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-08-07 08:02:56 +03:00

windows build: do not export externals from static library

If you are building a DLL, then you need to explicitly export each
entry point. When building a static library, you should not.

libssh2 was exporting the entry points whether it was building a DLL or a
static library. To elaborate further, if libssh2 was used as a static
library, which was being linked into a DLL, the libssh2 API would be
exported from that separate DLL.
This commit is contained in:
Bob Kast
2014-04-08 15:26:57 -04:00
committed by Marc Hoersken
parent 18fe507324
commit c355d31ff9

View File

@@ -100,11 +100,15 @@ extern "C" {
/* Allow alternate API prefix from CFLAGS or calling app */ /* Allow alternate API prefix from CFLAGS or calling app */
#ifndef LIBSSH2_API #ifndef LIBSSH2_API
# ifdef LIBSSH2_WIN32 # ifdef LIBSSH2_WIN32
# ifdef LIBSSH2_LIBRARY # ifdef _WINDLL
# define LIBSSH2_API __declspec(dllexport) # ifdef LIBSSH2_LIBRARY
# define LIBSSH2_API __declspec(dllexport)
# else
# define LIBSSH2_API __declspec(dllimport)
# endif /* LIBSSH2_LIBRARY */
# else # else
# define LIBSSH2_API __declspec(dllimport) # define LIBSSH2_API
# endif /* LIBSSH2_LIBRARY */ # endif
# else /* !LIBSSH2_WIN32 */ # else /* !LIBSSH2_WIN32 */
# define LIBSSH2_API # define LIBSSH2_API
# endif /* LIBSSH2_WIN32 */ # endif /* LIBSSH2_WIN32 */