diff options
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | tests/common.h | 10 |
2 files changed, 11 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index bb12619..27dbb7b 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # # Copyright (C) 2006 Luke Howard # Copyright (C) 2006 West Consulting -# Copyright (C) 2006-2019 Arthur de Jong +# Copyright (C) 2006-2021 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -351,7 +351,7 @@ AC_ARG_WITH(nss-maps, [ with_nss_maps="all" ]) # checks for availability of header files -AC_CHECK_HEADERS([ctype.h strings.h pthread.h pthread_np.h fcntl.h limits.h]) +AC_CHECK_HEADERS([ctype.h strings.h pthread.h pthread_np.h fcntl.h limits.h assert.h]) AC_CHECK_HEADERS([nss.h nss_common.h grp.h shadow.h aliases.h netdb.h rpc/rpcent.h]) AC_CHECK_HEADERS([netinet/ether.h arpa/inet.h netinet/in.h]) AC_CHECK_HEADERS([nsswitch.h nss_dbdefs.h]) @@ -368,7 +368,7 @@ AC_SEARCH_LIBS(socket, socket) AC_CHECK_FUNCS([strcasecmp strncasecmp strchr strcspn strspn strtol strtoul strtoull strndup]) AC_CHECK_FUNCS([malloc realloc atexit]) AC_FUNC_FORK -AC_CHECK_FUNCS(__assert_fail) +AC_CHECK_FUNCS([__assert_fail __assert __assert_c99]) AC_SEARCH_LIBS(clock_gettime, rt) AC_CHECK_FUNCS([setusershell getusershell endusershell getgrouplist]) AC_CHECK_DECLS([setusershell, getusershell, endusershell]) diff --git a/tests/common.h b/tests/common.h index fb6ca8f..f66a48f 100644 --- a/tests/common.h +++ b/tests/common.h @@ -2,7 +2,7 @@ common.h - common test routines This file is part of the nss-pam-ldapd library. - Copyright (C) 2011, 2012 Arthur de Jong + Copyright (C) 2011-2021 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -24,6 +24,7 @@ #define TEST__COMMON_H 1 #include <errno.h> +#include <assert.h> #ifndef __ASSERT_FUNCTION #define __ASSERT_FUNCTION "" @@ -33,9 +34,14 @@ #ifndef HAVE___ASSERT_FAIL /* for Solaris: */ #ifdef sun +#if defined(HAVE___ASSERT_C99) +#define __assert_fail(assertion, file, line, function) \ + __assert_c99(assertion, file, line, function) +#elif defined(HAVE___ASSERT) #define __assert_fail(assertion, file, line, function) \ __assert(assertion, file, line) -#endif +#endif /* HAVE___ASSERT_C99 or HAVE___ASSERT */ +#endif /* sun */ /* for FreeBSD: */ #ifdef __FreeBSD__ #define __assert_fail(assertion, file, line, function) \ |