diff --git a/config/hwloc.m4 b/config/hwloc.m4
index 855244d..49955a6 100644
--- a/config/hwloc.m4
+++ b/config/hwloc.m4
@@ -367,7 +367,7 @@ EOF])
     AC_CHECK_HEADERS([ctype.h])
 
     AC_CHECK_FUNCS([strncasecmp], [
-      _HWLOC_CHECK_DECL([strncasecmp], [
+      AC_CHECK_DECLS([strncasecmp], [
 	AC_DEFINE([HWLOC_HAVE_DECL_STRNCASECMP], [1], [Define to 1 if function `strncasecmp' is declared by system headers])
       ])
     ])
@@ -524,7 +524,7 @@ EOF])
       AC_DEFINE_UNQUOTED(hwloc_thread_t, $hwloc_thread_t, [Define this to the thread ID type])
     fi
 
-    _HWLOC_CHECK_DECL([sched_setaffinity], [
+    AC_CHECK_DECLS([sched_setaffinity], [
       AC_DEFINE([HWLOC_HAVE_SCHED_SETAFFINITY], [1], [Define to 1 if glibc provides a prototype of sched_setaffinity()])
       AS_IF([test "$HWLOC_STRICT_ARGS_CFLAGS" = "FAIL"],[
         AC_MSG_WARN([Support for sched_setaffinity() requires a C compiler which])
@@ -594,7 +594,7 @@ EOF])
     AC_PATH_PROG([BASH], [bash])
 
     AC_CHECK_FUNCS([ffs], [
-      _HWLOC_CHECK_DECL([ffs],[
+      AC_CHECK_DECLS([ffs],[
         AC_DEFINE([HWLOC_HAVE_DECL_FFS], [1], [Define to 1 if function `ffs' is declared by system headers])
       ])
       AC_DEFINE([HWLOC_HAVE_FFS], [1], [Define to 1 if you have the `ffs' function.])
@@ -613,33 +613,33 @@ EOF])
       fi
     ])
     AC_CHECK_FUNCS([ffsl], [
-      _HWLOC_CHECK_DECL([ffsl],[
+      AC_CHECK_DECLS([ffsl],[
         AC_DEFINE([HWLOC_HAVE_DECL_FFSL], [1], [Define to 1 if function `ffsl' is declared by system headers])
       ])
       AC_DEFINE([HWLOC_HAVE_FFSL], [1], [Define to 1 if you have the `ffsl' function.])
     ])
 
     AC_CHECK_FUNCS([fls], [
-      _HWLOC_CHECK_DECL([fls],[
+      AC_CHECK_DECLS([fls],[
         AC_DEFINE([HWLOC_HAVE_DECL_FLS], [1], [Define to 1 if function `fls' is declared by system headers])
       ])
       AC_DEFINE([HWLOC_HAVE_FLS], [1], [Define to 1 if you have the `fls' function.])
     ])
     AC_CHECK_FUNCS([flsl], [
-      _HWLOC_CHECK_DECL([flsl],[
+      AC_CHECK_DECLS([flsl],[
         AC_DEFINE([HWLOC_HAVE_DECL_FLSL], [1], [Define to 1 if function `flsl' is declared by system headers])
       ])
       AC_DEFINE([HWLOC_HAVE_FLSL], [1], [Define to 1 if you have the `flsl' function.])
     ])
 
     AC_CHECK_FUNCS([clz], [
-      _HWLOC_CHECK_DECL([clz],[
+      AC_CHECK_DECLS([clz],[
         AC_DEFINE([HWLOC_HAVE_DECL_CLZ], [1], [Define to 1 if function `clz' is declared by system headers])
       ])
       AC_DEFINE([HWLOC_HAVE_CLZ], [1], [Define to 1 if you have the `clz' function.])
     ])
     AC_CHECK_FUNCS([clzl], [
-      _HWLOC_CHECK_DECL([clzl],[
+      AC_CHECK_DECLS([clzl],[
         AC_DEFINE([HWLOC_HAVE_DECL_CLZL], [1], [Define to 1 if function `clzl' is declared by system headers])
       ])
       AC_DEFINE([HWLOC_HAVE_CLZL], [1], [Define to 1 if you have the `clzl' function.])
@@ -1226,26 +1226,6 @@ AC_DEFUN([_HWLOC_CHECK_DIFF_W], [
 
 #-----------------------------------------------------------------------
 
-dnl HWLOC_CHECK_DECL
-dnl
-dnl Check declaration of given function by trying to call it with an insane
-dnl number of arguments (10). Success means the compiler couldn't really check.
-AC_DEFUN([_HWLOC_CHECK_DECL], [
-  AC_MSG_CHECKING([whether function $1 is declared])
-  AC_REQUIRE([AC_PROG_CC])
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-       [AC_INCLUDES_DEFAULT([$4])
-	void * $1;],
-    )],
-    [AC_MSG_RESULT([no])
-     $3],
-    [AC_MSG_RESULT([yes])
-     $2]
-  )
-])
-
-#-----------------------------------------------------------------------
-
 dnl HWLOC_CHECK_DECLS
 dnl
 dnl Same as HWLOCK_CHECK_DECL, but defines HAVE_DECL_foo to 1 or 0 depending on
