summaryrefslogtreecommitdiffstats
path: root/dirmngr
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2014-03-07 09:46:44 +0100
committerWerner Koch <wk@gnupg.org>2014-03-07 19:20:57 +0100
commitfeda379595e06583bc5b3610dec74890de29cb8e (patch)
tree03c43c440a4ab98a2b596d2b76d6f0a561ba165e /dirmngr
parentSilence more warnings about unused vars and args. (diff)
downloadgnupg2-feda379595e06583bc5b3610dec74890de29cb8e.tar.xz
gnupg2-feda379595e06583bc5b3610dec74890de29cb8e.zip
dirmmgr: Use a portability wrapper for struct timeval.
* dirmngr/dirmngr_ldap.c [W32]: Include winber.h. (my_ldap_timeval_t): New.
Diffstat (limited to 'dirmngr')
-rw-r--r--dirmngr/dirmngr_ldap.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/dirmngr/dirmngr_ldap.c b/dirmngr/dirmngr_ldap.c
index 4e706d52c..7d3bd1794 100644
--- a/dirmngr/dirmngr_ldap.c
+++ b/dirmngr/dirmngr_ldap.c
@@ -37,14 +37,15 @@
#endif
#ifdef HAVE_W32_SYSTEM
-#include <winsock2.h>
-#include <winldap.h>
-#include <fcntl.h>
-#include "ldap-url.h"
+# include <winsock2.h>
+# include <winldap.h>
+# include <winber.h>
+# include <fcntl.h>
+# include "ldap-url.h"
#else
-/* For OpenLDAP, to enable the API that we're using. */
-#define LDAP_DEPRECATED 1
-#include <ldap.h>
+ /* For OpenLDAP, to enable the API that we're using. */
+# define LDAP_DEPRECATED 1
+# include <ldap.h>
#endif
@@ -97,6 +98,12 @@ static void npth_protect (void) { }
# define my_ldap_free_attr(a) ldap_memfree ((a))
#endif
+#ifdef HAVE_W32_SYSTEM
+ typedef LDAP_TIMEVAL my_ldap_timeval_t;
+#else
+ typedef struct timeval my_ldap_timeval_t;
+#endif
+
#define DEFAULT_LDAP_TIMEOUT 100 /* Arbitrary long timeout. */
@@ -154,7 +161,7 @@ struct my_opt_s
{
int quiet;
int verbose;
- struct timeval timeout; /* Timeout for the LDAP search functions. */
+ my_ldap_timeval_t timeout;/* Timeout for the LDAP search functions. */
unsigned int alarm_timeout; /* And for the alarm based timeout. */
int multi;