Re: [PATCH]; request for votes] Cygwin: Make it again possible to build with OpenSSL

Bart Van Assche <[email protected]>
Newsgroups gmane.network.net-snmp.devel
Message-ID <[email protected]>
On 05/21/18 09:43, Wes Hardaker wrote:
> Bart Van Assche <[email protected]> writes:
> 
>> Remove #define OPENSSL_SYS_WIN32 since that tells OpenSSL to include
>> the Winsock header file. Define VC_EXTRALEAN and WIN32_LEAN_AND_MEAN
>> to avoid that header files are included from <windows.h> that conflict
>> with the OpenSSL header files. This patch avoids that building without
>> --with-openssl=internal fails.
> 
> Do you have any idea if this means it will only build with new versions
> of OpenSSL on cygwin?  IE, with this patch in place on an older system
> does it still build there too?

Hello Wes,

This patch should work for both newer and older Cygwin versions. The 
description of commit 0657b90b7181 is as follows:

  Cygwin, scapi.h: Fix build

  Recent versions of the Cygwin openssl header files and <windows.h>
  are incompatible because both define X509_NAME unless OPENSSL_SYS_WIN32
  is defined. Hence avoid including openssl header files in source files
  that include <windows.h>.

Defining WIN32_LEAN_AND_MEAN causes windows.h not to include the header 
file that defines all the X509_* symbols, including X509_NAME. In other 
words, the patch I posted is a better version of commit 0657b90b7181.

Bart.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.