/*** These need dir.h for sure ***/

#if defined(NeXT) || defined(n16) || defined(sequent)
#  include <sys/dir.h>
#  define  dirent direct
#  define S_ISDIR(m)      (((m)&S_IFMT) == S_IFDIR)
#  define S_ISREG(m)      (((m)&S_IFMT) == S_IFREG)

/*** These can use dirent for sure ***/

#else
#  if  defined(sun) || defined(ultrix) || defined(hpux) || defined(__sgi) || \
       defined(_AIX) || defined(_SYSV_SOURCE)
#      include <dirent.h>

/*** Everyone else gets dir.h ***/

#  else
#      include <sys/dir.h>
#      define  dirent direct
#      define S_ISDIR(m)      (((m)&S_IFMT) == S_IFDIR)
#      define S_ISREG(m)      (((m)&S_IFMT) == S_IFREG)
#  endif
#endif
