diff --git a/keyserver/gpgkeys_ldap.c b/keyserver/gpgkeys_ldap.c index 453632502..354195778 100644 --- a/keyserver/gpgkeys_ldap.c +++ b/keyserver/gpgkeys_ldap.c @@ -66,6 +66,20 @@ #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; @@ -460,7 +474,7 @@ build_attrs(LDAPMod ***modlist,char *line) case 'R': revoked=1; break; - + case 'd': case 'D': disabled=1; @@ -1043,7 +1057,7 @@ get_key(char *getkey) else { /* short key id */ - + sprintf(search,"(pgpkeyid=%.8s)",getkey); } @@ -1773,12 +1787,12 @@ find_basekeyspacedn(void) } ldap_msgfree(si_res); - } + } return LDAP_SUCCESS; } -static void +static void show_help (FILE *fp) { fprintf (fp,"-h, --help\thelp\n"); @@ -2195,7 +2209,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) { diff --git a/scripts/autogen.sh b/scripts/autogen.sh index 408f760f0..9d3e7396a 100755 --- a/scripts/autogen.sh +++ b/scripts/autogen.sh @@ -56,7 +56,7 @@ if test "$1" = "--build-w32"; then # Locate the cross compiler crossbindir= - for host in i586-mingw32msvc i386-mingw32msvc; do + for host in i686-w64-mingw32 i586-mingw32msvc i386-mingw32msvc; do if ${host}-gcc --version >/dev/null 2>&1 ; then crossbindir=/usr/${host}/bin conf_CC="CC=${host}-gcc" diff --git a/util/miscutil.c b/util/miscutil.c index f82c4d941..f0cbaca51 100644 --- a/util/miscutil.c +++ b/util/miscutil.c @@ -31,6 +31,10 @@ #include "util.h" #include "i18n.h" +#ifndef HAVE_TIMEGM +time_t timegm (struct tm *tm); +#endif + #ifdef HAVE_UNSIGNED_TIME_T # define INVALID_TIME_CHECK(a) ((a) == (time_t)(-1)) #else