Allow building gpgkeys_ldap with the 32 bit mingw-w64 toolchain.

* keyserver/gpgkeys_ldap.c (my_ldap_start_tls_s): Define macro
depending on compiler version.
(main): Use new macro.
--

It seems that the LDAP keyserver helper if build with the old mingw32
toolchain never worked correctly for LDAPS.  The prototype there for
ldap_start_tls_s is plainly wrong for Windows.  However, the fix here
has special support so not to break building with the old compiler.
This commit is contained in:
Werner Koch 2013-04-23 17:04:56 +02:00
parent d6e37554d2
commit a557a74615
1 changed files with 16 additions and 1 deletions

View File

@ -61,6 +61,21 @@
#include "util.h"
#endif
#if HAVE_W32_SYSTEM
# if !defined(__MINGW64_VERSION_MAJOR) || !defined(__MINGW32_MAJOR_VERSION)
/* This is mingw32 with bogus ldap definitions; i.e. Unix style
LDAP definitions. */
# define my_ldap_start_tls_s(a,b,c) ldap_start_tls_sA ((a),(b),(c))
# else
/* Standard Microsoft or mingw64. */
# define my_ldap_start_tls_s(a,b,c) ldap_start_tls_sA ((a),NULL,NULL,(b),(c))
# endif
#else /*!W32*/
# define my_ldap_start_tls_s(a,b,c) ldap_start_tls_s ((a),(b),(c))
#endif /*!W32*/
extern char *optarg;
extern int optind;
@ -2189,7 +2204,7 @@ main(int argc,char *argv[])
#endif
if(err==LDAP_SUCCESS)
err=ldap_start_tls_s(ldap,NULL,NULL);
err = my_ldap_start_tls_s (ldap, NULL, NULL);
if(err!=LDAP_SUCCESS)
{