diff options
author | Werner Koch <[email protected]> | 2013-04-23 15:04:56 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2013-04-23 15:04:56 +0000 |
commit | a557a74615774b228dae14cf83a92ec26e2b03b5 (patch) | |
tree | 82127c3a29c17228bee62f13900664efdd02124f | |
parent | Update NEWS and README (diff) | |
download | gnupg-a557a74615774b228dae14cf83a92ec26e2b03b5.tar.gz gnupg-a557a74615774b228dae14cf83a92ec26e2b03b5.zip |
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.
-rw-r--r-- | keyserver/gpgkeys_ldap.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/keyserver/gpgkeys_ldap.c b/keyserver/gpgkeys_ldap.c index bd8523466..9f99b28e9 100644 --- a/keyserver/gpgkeys_ldap.c +++ b/keyserver/gpgkeys_ldap.c @@ -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) { |