Hello,
in the file crypto/sha/sha.h there is this line:
#if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
used to conditionally declare SHA_LONG64 and U64 macros.
Unfortunately, this causes OpenSSL to be unusable on Cygwin because,
obviously, __MINGW32__ is not declared.
A fix could be made by appending "&& !defined(__CYGWIN__)" but in my opinion
it is better to replace the last test with "&& defined(_MSC_VER)" because
things like "__int64" and "UI64" are not standard extensions and they should be
supported only if we are targetting to Microsoft VisualC++.
Without this thing fixed, I was not able to make it working... for example, if
you run an autoconf script that it checks the presence of openssl.h, you will
get a message like "found but cannot be used. Missing pre-requisites?"
Attached patch fixes this defect.
Sincerely,
Carlo Bramini.
diff --git a/crypto/sha/sha.h b/crypto/sha/sha.h
index 16cacf9..a8a4937 100644
--- a/crypto/sha/sha.h
+++ b/crypto/sha/sha.h
@@ -158,7 +158,7 @@ void SHA256_Transform(SHA256_CTX *c, const unsigned char
*data);
#define SHA512_CBLOCK (SHA_LBLOCK*8) /* SHA-512 treats input data as a
* contiguous array of 64 bit
* wide big-endian values. */
-#if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
+#if (defined(_WIN32) || defined(_WIN64)) && defined(_MSC_VER)
#define SHA_LONG64 unsigned __int64
#define U64(C) C##UI64
#elif defined(__arch64__)