>On Feb 23 17:01, [email protected] via RT wrote:
>> 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.
>
>
> Dunno what your problem exactly is, but openssl-1.0.1e is part of the
> official Cygwin distro at cygwin.com.  Lots of packages in the distro
> are built against OpenSSL.
>
> The problem you have here looks self-induced.  Neither _WIN32 nor _WIN64
> are defined by default when building on Cygwin.  _WIN32 is not defined
> either when including <windows.h>, at least not if you use the current
> w32api headers of the mingw64 project.  _WIN64 is only defined when
> including <windows.h> and building for the 64 bit version of Cygwin,
> which isn't released yet.
>
> So, bottom line is, I don't think that your patch is necessary.  You
> should rather make sure that _WIN32 isn't defined accidentally in your
> scenario.
>
>
> Corinna
>
> -- 
> Corinna Vinschen
> Cygwin Maintainer
> Red Hat
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> Development Mailing List                       [email protected]
> Automated List Manager                           [email protected]
>

Hello,
sorry if I have not replied... I was expecting some changes in the bug tracker 
instead of in the mailing list, my mistake.

Actually, in my opinion the bug is real: I believe you can't rely just on 
_WIN32 and on _WIN64 macro because, as you said, it is enough to include 
windows.h in the checked headers or to add -D_WIN32 to CFLAGS to fail autoconf, 
which may be required by other packages.
Alternatively, if you prefer, the patch could also be changed as:

#if (defined(_WIN32) || defined(_WIN64)) && !defined(__GNUC__)

because you simply can't use the following lines in a different environment 
than VisualC++ or something that it does not mimic exactly the compiler made by 
Microsoft: if <windows.h> is included, somehow you may be able to use 
__int8/__int16/__int32/__int64 because they will be provided by its inclusion, 
but anyways you won't be surely able to append UI64 to a long long type.
By the way, this also breaks openssl on MSYS, for the same reason.
Thank you very much for your time and your patience.

Sincerely,

Carlo Bramini.

Reply via email to