-dnl Unconditionally enables the replacement of <dirent.h>.
-AC_DEFUN([gl_REPLACE_DIRENT_H],
-[
- dnl This is a no-op, because <dirent.h> is always overridden.
- :
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <dirent.h>
+ ]], [alphasort dirfd fdopendir scandir])