Test HAVE_DIRENT_H, HAVE_SYS_DIR_H, HAVE_NDIR_H instead of DIRENT, SYSDIR,

NDIR.
This commit is contained in:
Roland McGrath 1994-11-08 00:14:50 +00:00
parent e55ed78080
commit e4c43aab3e

18
dir.c
View file

@ -18,26 +18,26 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "make.h" #include "make.h"
#if defined (POSIX) || defined (DIRENT) || defined (__GNU_LIBRARY__) #if defined (POSIX) || defined (HAVE_DIRENT_H) || defined (__GNU_LIBRARY__)
#include <dirent.h> #include <dirent.h>
#ifndef __GNU_LIBRARY__ #ifndef __GNU_LIBRARY__
#define D_NAMLEN(d) strlen((d)->d_name) #define D_NAMLEN(d) strlen((d)->d_name)
#else /* GNU C library. */ #else /* GNU C library. */
#define D_NAMLEN(d) ((d)->d_namlen) #define D_NAMLEN(d) ((d)->d_namlen)
#endif /* Not GNU C library. */ #endif /* Not GNU C library. */
#else /* Not POSIX or DIRENT. */ #else /* Not POSIX or HAVE_DIRENT_H. */
#define direct dirent #define direct dirent
#define D_NAMLEN(d) ((d)->d_namlen) #define D_NAMLEN(d) ((d)->d_namlen)
#ifdef SYSNDIR #ifdef HAVE_SYS_NDIR_H
#include <sys/ndir.h> #include <sys/ndir.h>
#endif /* SYSNDIR */ #endif /* HAVE_SYS_NDIR_H */
#ifdef SYSDIR #ifdef HAVE_SYS_DIR_H
#include <sys/dir.h> #include <sys/dir.h>
#endif /* SYSDIR */ #endif /* HAVE_SYS_DIR_H */
#ifdef NDIR #ifdef HAVE_NDIR_H
#include <ndir.h> #include <ndir.h>
#endif /* NDIR */ #endif /* HAVE_NDIR_H */
#endif /* POSIX or DIRENT or __GNU_LIBRARY__. */ #endif /* POSIX or HAVE_DIRENT_H or __GNU_LIBRARY__. */
#if defined (POSIX) && !defined (__GNU_LIBRARY__) #if defined (POSIX) && !defined (__GNU_LIBRARY__)
/* Posix does not require that the d_ino field be present, and some /* Posix does not require that the d_ino field be present, and some