When compiling against openldap 2.6.0 kamailio's private ldap_connect() clashes
with openldap's own. curl dealt with a similar issue earlier (see [1]).
Simply rename the function to avoid the issue.
In file included from ldap_api_fn.c:37:
ldap_connect.h:34:12: error: conflicting types for 'ldap_connect'; have 'int(char *)'
34 | extern int ldap_connect(char *_ld_name);
| ^~~~~~~~~~~~
In file included from ldap_api_fn.c:33:
/home/sk/tmp/sdk/openwrt-sdk-ath79-generic_gcc-11.2.0_musl.Linux-x86_64/staging_dir/target-mips_24kc_musl/usr/include/ldap.h:1555:1: note: previous declaration of 'ldap_connect' with type 'int(LDAP *)' {aka 'int(struct ldap *)'}
1555 | ldap_connect( LDAP *ld );
| ^~~~~~~~~~~~
make[5]: *** [../../Makefile.rules:100: ldap_api_fn.o] Error 1
make[4]: *** [Makefile:511: modules] Error 1
[1] https://github.com/curl/curl/commit/8bdde6b14ce3b5fd71c772a578fcbd4b6fa6df19
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
(cherry picked from commit 362c6de08058948d0a70a1eeb14ec718f922b4e5)
... | ... |
@@ -31,7 +31,7 @@ |
31 | 31 |
#include "../../core/str.h" |
32 | 32 |
#include "../../core/dprint.h" |
33 | 33 |
|
34 |
-extern int ldap_connect(char *_ld_name); |
|
34 |
+extern int oldap_connect(char *_ld_name); |
|
35 | 35 |
extern int ldap_disconnect(char *_ld_name); |
36 | 36 |
extern int ldap_reconnect(char *_ld_name); |
37 | 37 |
extern int ldap_get_vendor_version(char **_version); |