fix VS 2015 openssl static link

This commit is contained in:
Alex Fabijanic 2015-12-13 00:28:00 -06:00
parent 75c2138957
commit 50ae257a52
3 changed files with 26 additions and 4 deletions

View File

@ -60,11 +60,18 @@ enum RSAPaddingMode
// Crypto_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported.
//
#if defined(_WIN32) && defined(POCO_DLL)
#if defined(Crypto_EXPORTS)
#define Crypto_API __declspec(dllexport)
#if defined(_WIN32)
#if defined(POCO_DLL)
#if defined(Crypto_EXPORTS)
#define Crypto_API __declspec(dllexport)
#else
#define Crypto_API __declspec(dllimport)
#endif
#else
#define Crypto_API __declspec(dllimport)
#if (POCO_MSVS_VERSION >= 2015) // needed for OpenSSL
#pragma comment(lib, "legacy_stdio_definitions.lib")
#pragma comment(lib, "legacy_stdio_wide_specifiers.lib")
#endif
#endif
#endif

View File

@ -122,4 +122,10 @@ inline void OpenSSLInitializer::disableSSLInitialization()
} } // namespace Poco::Crypto
// needed for OpenSSL static link
#if defined(_WIN32) && !defined(POCO_DLL) && (POCO_MSVS_VERSION >= 2015)
extern "C" FILE * __cdecl __iob_func(void);
#endif
#endif // Crypto_OpenSSLInitializer_INCLUDED

View File

@ -184,3 +184,12 @@ void uninitializeCrypto()
} } // namespace Poco::Crypto
// needed for OpenSSL static link
#if defined(_WIN32) && !defined(POCO_DLL) && (POCO_MSVS_VERSION >= 2015)
FILE * __cdecl __iob_func(void)
{
static FILE poco_iob[] = { stdin, stdout, stderr };
return poco_iob;
}
#endif