Imported Upstream version 2.6.0
[debian/amanda] / config / amanda / readdir.m4
1 # SYNOPSIS
2 #
3 #   AMANDA_CHECK_READDIR
4 #
5 # OVERVIEW
6 #
7 #   Check for one of the readdir variants, as well as the dirent headers.
8 #   See common-src/util.c and amanda.h for the use of these symbols.
9 #
10 AC_DEFUN([AMANDA_CHECK_READDIR], [
11     AC_HEADER_DIRENT
12
13     # include the dirent headers as described in the autoconf documentation.
14     AC_CHECK_DECLS([readdir, readdir_r, readdir64, readdir64_r],,,[
15 #if HAVE_DIRENT_H
16 # include <dirent.h>
17 # define NAMLEN(dirent) strlen((dirent)->d_name)
18 #else
19 # define dirent direct
20 # define NAMLEN(dirent) (dirent)->d_namlen
21 # if HAVE_SYS_NDIR_H
22 #  include <sys/ndir.h>
23 # endif
24 # if HAVE_SYS_DIR_H
25 #  include <sys/dir.h>
26 # endif
27 # if HAVE_NDIR_H
28 #  include <ndir.h>
29 # endif
30 #endif
31     ])
32 ])