diff options
| author | Yang Tse <yangsita@gmail.com> | 2010-06-01 17:25:03 +0200 | 
|---|---|---|
| committer | Yang Tse <yangsita@gmail.com> | 2010-06-01 17:25:03 +0200 | 
| commit | 89da5324457070cb4a7391c48c6c4f84ed7fe964 (patch) | |
| tree | d989117972a8aa3dd27f62c0ad7b63a7502187f0 /lib | |
| parent | b38189c7b41cc2a327ab690a523441bcb3e6f9fe (diff) | |
fix ldap related compilation issues
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/curl_ldap.h | 7 | ||||
| -rw-r--r-- | lib/ldap.c | 16 | ||||
| -rw-r--r-- | lib/openldap.c | 15 | ||||
| -rw-r--r-- | lib/url.c | 5 | ||||
| -rw-r--r-- | lib/version.c | 5 | 
5 files changed, 37 insertions, 11 deletions
diff --git a/lib/curl_ldap.h b/lib/curl_ldap.h index a2b167fa0..3cce4bf7b 100644 --- a/lib/curl_ldap.h +++ b/lib/curl_ldap.h @@ -8,7 +8,7 @@   *                            | (__| |_| |  _ <| |___   *                             \___|\___/|_| \_\_____|   * - * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.   *   * This software is licensed as described in the file COPYING, which   * you should have received as part of this distribution. The terms @@ -22,10 +22,11 @@   * KIND, either express or implied.   *   ***************************************************************************/ -#if !defined(CURL_DISABLE_LDAP) || defined(USE_OPENLDAP) +#ifndef CURL_DISABLE_LDAP  extern const struct Curl_handler Curl_handler_ldap; -#if defined(HAVE_LDAP_SSL) || defined(USE_OPENLDAP) +#if (defined(USE_OPENLDAP) && defined(USE_SSL)) || \ +   (!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL))  extern const struct Curl_handler Curl_handler_ldaps;  #endif diff --git a/lib/ldap.c b/lib/ldap.c index 06c229042..e837dbfdd 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -5,7 +5,7 @@   *                | (__| |_| |  _ <| |___   *                 \___|\___/|_| \_\_____|   * - * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.   *   * This software is licensed as described in the file COPYING, which   * you should have received as part of this distribution. The terms @@ -23,6 +23,18 @@  #include "setup.h"  #if !defined(CURL_DISABLE_LDAP) && !defined(USE_OPENLDAP) + +/* + * Notice that USE_OPENLDAP is only a source code selection switch. When + * libcurl is built with USE_OPENLDAP defined the libcurl source code that + * gets compiled is the code from openldap.c, otherwise the code that gets + * compiled is the code from ldap.c. + * + * When USE_OPENLDAP is defined a recent version of the OpenLDAP library + * might be required for compilation and runtime. In order to use ancient + * OpenLDAP library versions, USE_OPENLDAP shall not be defined. + */ +  /* -- WIN32 approved -- */  #include <stdio.h>  #include <string.h> @@ -715,4 +727,4 @@ static void _ldap_free_urldesc (LDAPURLDesc *ludp)    free (ludp);  }  #endif  /* !HAVE_LDAP_URL_PARSE */ -#endif  /* CURL_DISABLE_LDAP */ +#endif  /* !CURL_DISABLE_LDAP && !USE_OPENLDAP */ diff --git a/lib/openldap.c b/lib/openldap.c index 16bf7b8c8..daba224ed 100644 --- a/lib/openldap.c +++ b/lib/openldap.c @@ -22,7 +22,18 @@  #include "setup.h" -#ifdef USE_OPENLDAP +#if !defined(CURL_DISABLE_LDAP) && defined(USE_OPENLDAP) + +/* + * Notice that USE_OPENLDAP is only a source code selection switch. When + * libcurl is built with USE_OPENLDAP defined the libcurl source code that + * gets compiled is the code from openldap.c, otherwise the code that gets + * compiled is the code from ldap.c. + * + * When USE_OPENLDAP is defined a recent version of the OpenLDAP library + * might be required for compilation and runtime. In order to use ancient + * OpenLDAP library versions, USE_OPENLDAP shall not be defined. + */  #include "urldata.h"  #include <curl/curl.h> @@ -588,4 +599,4 @@ static Sockbuf_IO ldapsb_tls =  };  #endif /* USE_SSL */ -#endif  /* USE_OPENLDAP */ +#endif /* !CURL_DISABLE_LDAP && USE_OPENLDAP */ @@ -181,9 +181,10 @@ static const struct Curl_handler * const protocols[] = {    &Curl_handler_dict,  #endif -#if !defined(CURL_DISABLE_LDAP) || defined(USE_OPENLDAP) +#ifndef CURL_DISABLE_LDAP    &Curl_handler_ldap, -#if defined(HAVE_LDAP_SSL) || (defined(USE_OPENLDAP) && defined(USE_SSL)) +#if (defined(USE_OPENLDAP) && defined(USE_SSL)) || \ +   (!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL))    &Curl_handler_ldaps,  #endif  #endif diff --git a/lib/version.c b/lib/version.c index d482bff1e..9a336a32d 100644 --- a/lib/version.c +++ b/lib/version.c @@ -170,9 +170,10 @@ static const char * const protocols[] = {  #if defined(USE_SSL) && !defined(CURL_DISABLE_IMAP)    "imaps",  #endif -#if !defined(CURL_DISABLE_LDAP) || defined(USE_OPENLDAP) +#ifndef CURL_DISABLE_LDAP    "ldap", -#if defined(HAVE_LDAP_SSL) || (defined(USE_OPENLDAP) && defined(USE_SSL)) +#if (defined(USE_OPENLDAP) && defined(USE_SSL)) || \ +   (!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL))    "ldaps",  #endif  #endif  | 
