Add `getservbyname_r` prototype detection to CMake

OpenBSD's prototype is differ than glibc's one, but it is declared.

Signed-off-by: OBATA Akio <obache@wizdas.com>
(cherry picked from commit 6886dd7e96)
v3.5.13-sru
OBATA Akio 4 years ago committed by Slávek Banko
parent bdf8756ae1
commit 3242ddae6c
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -378,6 +378,7 @@ check_function_exists( getpeername HAVE_GETPEERNAME )
check_function_exists( getprotobyname_r HAVE_GETPROTOBYNAME_R ) check_function_exists( getprotobyname_r HAVE_GETPROTOBYNAME_R )
check_function_exists( getpt HAVE_GETPT ) check_function_exists( getpt HAVE_GETPT )
check_function_exists( getservbyname_r HAVE_GETSERVBYNAME_R ) check_function_exists( getservbyname_r HAVE_GETSERVBYNAME_R )
check_symbol_exists( getservbyname_r "netdb.h" HAVE_DECL_GETSERVBYNAME_R )
check_function_exists( getservbyport_r HAVE_GETSERVBYPORT_R ) check_function_exists( getservbyport_r HAVE_GETSERVBYPORT_R )
check_function_exists( getsockname HAVE_GETSOCKNAME ) check_function_exists( getsockname HAVE_GETSOCKNAME )
check_function_exists( getsockopt HAVE_GETSOCKOPT ) check_function_exists( getsockopt HAVE_GETSOCKOPT )

@ -156,7 +156,7 @@
#cmakedefine HAVE_CUPS_1_6 1 #cmakedefine HAVE_CUPS_1_6 1
/* Define to 1 if you have the declaration of `getservbyname_r', and to 0 if you don't. */ /* Define to 1 if you have the declaration of `getservbyname_r', and to 0 if you don't. */
#undef HAVE_DECL_GETSERVBYNAME_R #cmakedefine01 HAVE_DECL_GETSERVBYNAME_R
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. */ /* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. */
#cmakedefine HAVE_DIRENT_H 1 #cmakedefine HAVE_DIRENT_H 1

@ -48,7 +48,6 @@ extern TQMutex getXXbyYYmutex;
#endif #endif
/* some systems have the functions, but don't declare them */ /* some systems have the functions, but don't declare them */
#ifndef __OpenBSD__
#if defined(HAVE_GETSERVBYNAME_R) && !HAVE_DECL_GETSERVBYNAME_R #if defined(HAVE_GETSERVBYNAME_R) && !HAVE_DECL_GETSERVBYNAME_R
extern "C" { extern "C" {
struct servent; struct servent;
@ -70,7 +69,6 @@ extern "C" {
struct protoent** result); struct protoent** result);
} }
#endif #endif
#endif
/* decide whether res_init is thread-safe or not */ /* decide whether res_init is thread-safe or not */
#if defined(__GLIBC__) #if defined(__GLIBC__)

Loading…
Cancel
Save