Include wincrypt.h when compiling with OpenSSL on Windows
authorFabian Keil <fk@fabiankeil.de>
Mon, 21 Sep 2020 13:42:04 +0000 (15:42 +0200)
committerFabian Keil <fk@fabiankeil.de>
Tue, 22 Sep 2020 14:22:04 +0000 (16:22 +0200)
commit01f1bf28d61df7ae3ef376ca6ae4432d68cddd24
tree704ff664d7ede18a1866f51109a14d91212bf783
parent1fc24ddb17476a9227652722aa83a1bd0ec2d2f7
Include wincrypt.h when compiling with OpenSSL on Windows

... but undefine X509_NAME and X509_EXTENSIONS.

Fixes:

    x86_64-w64-mingw32-gcc -c -pipe -O2 -Wshadow -DWINVER=0x501   -mwindows
    -Wall -Ipcre  openssl.c -o openssl.o
    In file included from
    P:/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:95,
                     from project.h:62,
                     from openssl.c:42:
    P:/msys64/mingw64/include/openssl/ssl.h:1611:5: error: expected
    specifier-qualifier-list before '(' token
     1611 |     X509_EXTENSIONS *tlsext_ocsp_exts;
          |     ^~~~~~~~~~~~~~~

when using OpenSSL 1.0.2.

Reported and partially submitted by: Hớ Hờ Hợ
project.h