@@ -3415,11 +3415,13 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
34153415int port = LDAP_DEF_PORT ,
34163416scope ,
34173417rc ,
3418- msgid ,
34193418size ,
34203419state ,
34213420oldstate ,
34223421i ;
3422+ #ifndef WIN32
3423+ int msgid ;
3424+ #endif
34233425bool found_keyword ;
34243426char * url ,
34253427* hostname ,
@@ -3564,11 +3566,13 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
35643566
35653567/*
35663568 * Perform an explicit anonymous bind.
3567- * LDAP does not require that an anonymous bind is preformed explicitly,
3569+ *
3570+ * LDAP does not require that an anonymous bind is performed explicitly,
35683571 * but we want to distinguish between the case where LDAP bind does not
35693572 * succeed within PGLDAP_TIMEOUT seconds (return 2 to continue parsing
35703573 * the service control file) and the case where querying the LDAP server
35713574 * fails (return 1 to end parsing).
3575+ *
35723576 * Unfortunately there is no way of setting a timeout that works for
35733577 * both Windows and OpenLDAP.
35743578 */
@@ -3581,7 +3585,7 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
35813585ldap_unbind (ld );
35823586return 2 ;
35833587}
3584- #else /* WIN32 */
3588+ #else /*! WIN32 */
35853589/* in OpenLDAP, use the LDAP_OPT_NETWORK_TIMEOUT option */
35863590if (ldap_set_option (ld ,LDAP_OPT_NETWORK_TIMEOUT ,& time )!= LDAP_SUCCESS )
35873591{
@@ -3836,7 +3840,8 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
38363840
38373841return 0 ;
38383842}
3839- #endif
3843+
3844+ #endif /* USE_LDAP */
38403845
38413846#define MAXBUFSIZE 256
38423847