dnl Provides a test to determine the correct way to call
dnl getservbyname_r:
dnl
-dnl - defines HAVE_FUNC_GETSERVBYNAME_R_6 if it needs 6 arguments (e.g linux)
+dnl - defines HAVE_FUNC_GETSERVBYNAME_R_6 if it needs 6 arguments (e.g. linux)
dnl - defines HAVE_FUNC_GETSERVBYNAME_R_5 if it needs 5 arguments (e.g. solaris)
dnl - defines HAVE_FUNC_GETSERVBYNAME_R_4 if it needs 4 arguments (e.g. osf/1)
dnl
AC_CACHE_CHECK(how many arguments getservbyname_r() takes,
ac_cv_func_which_getservbyname_r,
[
+ dnl we need to use C++ to detect missing prototypes
+ AC_LANG_PUSH(C++)
+
AC_TRY_COMPILE([#include <netdb.h>],
[
char *name;
)
]
)
+ AC_LANG_POP()
]
)