[sr #107560] libextra/openssl.h conflicts with wincrypt.h

LRN INVALID.NOREPLY at gnu.org
Sun Dec 26 03:40:26 CET 2010


URL:
  <http://savannah.gnu.org/support/?107560>

                 Summary: libextra/openssl.h conflicts with wincrypt.h
                 Project: GnuTLS
            Submitted by: lrn
            Submitted on: Sun 26 Dec 2010 02:40:25 AM GMT
                Category: None
                Priority: 5 - Normal
                Severity: 3 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

wincrypt.h from w32api MinGW package contains this line:
#define X509_NAME_VALUE ((LPCSTR) 6)

This conflicts with the definition from openssl.h:
  typedef gnutls_x509_dn X509_NAME;

and results in compile-time errors:
gnutls-2.10.4/libextra/gnutls_openssl.c:862:1: error: expected identifier or
'(' before 'LPCSTR'
gnutls-2.10.4/libextra/gnutls_openssl.c:862:1: error: expected ')' before
numeric constant
gnutls-2.10.4/libextra/gnutls_openssl.c:875:1: error: expected identifier or
'(' before 'LPCSTR'
gnutls-2.10.4/libextra/gnutls_openssl.c:875:1: error: expected ')' before
numeric constant

How to fix:
since wincrypt.h is included as a result of inclusion of sys/socket.h from
gnutls_int.h, the obvious fix is to add this to gnutls_int.h, after #include
<sys/socket.h>:

#if defined(X509_NAME) && defined(__WINCRYPT_H__)
#  undef X509_NAME
#endif

Another way to fix this is to use a different name, such as GNUTLS_X509_NAME




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/support/?107560>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





More information about the Gnutls-devel mailing list