Merge pull request #1863 from tmael/mingw32Fix

Fixed MINGW32 build errors
This commit is contained in:
toddouska
2018-10-04 09:15:01 -07:00
committed by GitHub
4 changed files with 15 additions and 14 deletions

View File

@ -1296,7 +1296,7 @@ int EmbedOcspLookup(void* ctx, const char* url, int urlSz,
httpBuf, httpBufSz); httpBuf, httpBufSz);
ret = wolfIO_TcpConnect(&sfd, domainName, port, io_timeout_sec); ret = wolfIO_TcpConnect(&sfd, domainName, port, io_timeout_sec);
if ((ret != 0) || (sfd < 0)) { if ((ret != 0) || ((int)sfd < 0)) {
WOLFSSL_MSG("OCSP Responder connection failed"); WOLFSSL_MSG("OCSP Responder connection failed");
} }
else if (wolfIO_Send(sfd, (char*)httpBuf, httpBufSz, 0) != else if (wolfIO_Send(sfd, (char*)httpBuf, httpBufSz, 0) !=

View File

@ -1120,17 +1120,18 @@ const ecc_set_type ecc_sets[] = {
#ifndef USE_WINDOWS_API #ifndef USE_WINDOWS_API
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
#else #else
0, 0, 0, 0, 0, 0, 0, 0, {0},{0},{0},{0},{0},{0},{0},{0},
#endif #endif
0, 0, 0 0, 0, 0
}, },
#endif #endif
{ {
0, -1, 0,
ECC_CURVE_INVALID,
#ifndef USE_WINDOWS_API #ifndef USE_WINDOWS_API
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
#else #else
0, 0, 0, 0, 0, 0, 0, 0, {0},{0},{0},{0},{0},{0},{0},{0},
#endif #endif
0, 0, 0 0, 0, 0
} }
@ -6459,7 +6460,7 @@ int wc_ecc_export_ex(ecc_key* key, byte* qx, word32* qxLen,
/* private key, d */ /* private key, d */
if (d != NULL) { if (d != NULL) {
if (dLen == NULL || if (dLen == NULL ||
(key->type != ECC_PRIVATEKEY && key->type != ECC_PRIVATEKEY_ONLY)) (key->type != ECC_PRIVATEKEY && key->type != ECC_PRIVATEKEY_ONLY))
return BAD_FUNC_ARG; return BAD_FUNC_ARG;

View File

@ -568,9 +568,9 @@ int wc_ecc_import_unsigned(ecc_key* key, byte* qx, byte* qy,
#endif /* HAVE_ECC_KEY_IMPORT */ #endif /* HAVE_ECC_KEY_IMPORT */
#ifdef HAVE_ECC_KEY_EXPORT #ifdef HAVE_ECC_KEY_EXPORT
WOLFSSL_API WOLFSSL_API
int wc_ecc_export_ex(ecc_key* key, byte* qx, word32* qxLen, int wc_ecc_export_ex(ecc_key* key, byte* qx, word32* qxLen,
byte* qy, word32* qyLen, byte* d, word32* dLen, byte* qy, word32* qyLen, byte* d, word32* dLen,
int encType); int encType);
WOLFSSL_API WOLFSSL_API
int wc_ecc_export_private_only(ecc_key* key, byte* out, word32* outLen); int wc_ecc_export_private_only(ecc_key* key, byte* out, word32* outLen);

View File

@ -43,19 +43,19 @@
*/ */
#if defined(BUILDING_WOLFSSL) #if defined(BUILDING_WOLFSSL)
#if defined(HAVE_VISIBILITY) && HAVE_VISIBILITY #if defined(_MSC_VER) || defined(__MINGW32__)
#define WOLFSSL_API __attribute__ ((visibility("default")))
#define WOLFSSL_LOCAL __attribute__ ((visibility("hidden")))
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
#define WOLFSSL_API __global
#define WOLFSSL_LOCAL __hidden
#elif defined(_MSC_VER) || defined(__MINGW32__)
#if defined(WOLFSSL_DLL) #if defined(WOLFSSL_DLL)
#define WOLFSSL_API __declspec(dllexport) #define WOLFSSL_API __declspec(dllexport)
#else #else
#define WOLFSSL_API #define WOLFSSL_API
#endif #endif
#define WOLFSSL_LOCAL #define WOLFSSL_LOCAL
#elif defined(HAVE_VISIBILITY) && HAVE_VISIBILITY
#define WOLFSSL_API __attribute__ ((visibility("default")))
#define WOLFSSL_LOCAL __attribute__ ((visibility("hidden")))
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
#define WOLFSSL_API __global
#define WOLFSSL_LOCAL __hidden
#else #else
#define WOLFSSL_API #define WOLFSSL_API
#define WOLFSSL_LOCAL #define WOLFSSL_LOCAL