Fixed compiler error with -Werror=implicit-function-declaration
authorBo Peng <pengbo@sraoss.co.jp>
Wed, 1 May 2024 06:42:10 +0000 (15:42 +0900)
committerBo Peng <pengbo@sraoss.co.jp>
Wed, 1 May 2024 06:42:10 +0000 (15:42 +0900)
- Add missing header files in autoconf check and
- Add LDAP_DEPRECATED to include prototypes for deprecated ldap functions

Patch is created by Vladimir Petko.

c-library.m4
src/auth/pool_hba.c
src/include/auth/pool_hba.h

index 74754b20e80519d6c827d256a82afadad287a106..482d250f651e18647ac5af1f4b8a353fb28a8b06 100644 (file)
@@ -230,6 +230,9 @@ AC_DEFUN([PGAC_FUNC_SNPRINTF_LONG_LONG_INT_FORMAT],
 AC_CACHE_VAL(pgac_cv_snprintf_long_long_int_format,
 [for pgac_format in '%lld' '%qd' '%I64d'; do
 AC_TRY_RUN([#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
 typedef long long int ac_int64;
 #define INT64_FORMAT "$pgac_format"
 
index f1170f1eba5a0f13a97d59a2e39a9b941b485389..202195b430b3efc534f096b458f734c17d0f36e8 100644 (file)
@@ -52,6 +52,7 @@
 #include "protocol/pool_process_query.h"
 
 #ifdef USE_LDAP
+#define LDAP_DEPRECATED 1
 #include <ldap.h>
 #endif
 
@@ -168,6 +169,7 @@ static POOL_CONNECTION * pam_frontend_kludge;       /* Workaround for passing
 #endif                                                 /* USE_PAM */
 
 #ifdef USE_LDAP
+#define LDAP_DEPRECATED 1
 #include <ldap.h>
 
 static POOL_STATUS CheckLDAPAuth(POOL_CONNECTION *frontend);
index 8c9e1ab0b1c4508c7b2cdf1f52b4f10232cee51e..a6e0a1533c1debda930d0a7ce2c48beb0af8095c 100644 (file)
@@ -30,6 +30,7 @@
 #include "pool.h"
 
 #ifdef USE_LDAP
+#define LDAP_DEPRECATED 1
 #include  <ldap.h>
 #endif