diff src/utils.cc @ 367:04d377033730

[project @ 1994-02-16 08:04:52 by jwe]
author jwe
date Wed, 16 Feb 1994 08:07:33 +0000
parents 4115f7713851
children 9e42358d1f1f
line wrap: on
line diff
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -55,7 +55,25 @@
 #include <iostream.h>
 #include <strstream.h>
 #include <fstream.h>
+
+// This mess suggested by the autoconf manual.
+// unistd.h defines _POSIX_VERSION on POSIX.1 systems.
+#if defined(DIRENT) || defined(_POSIX_VERSION)
 #include <dirent.h>
+#define NLENGTH(dirent) (strlen((dirent)->d_name))
+#else /* not (DIRENT or _POSIX_VERSION) */
+#define dirent direct
+#define NLENGTH(dirent) ((dirent)->d_namlen)
+#ifdef SYSNDIR
+#include <sys/ndir.h>
+#endif /* SYSNDIR */
+#ifdef SYSDIR
+#include <sys/dir.h>
+#endif /* SYSDIR */
+#ifdef NDIR
+#include <ndir.h>
+#endif /* NDIR */
+#endif /* not (DIRENT or _POSIX_VERSION) */
 
 #ifndef HAVE_STRCASECMP
 extern "C"
@@ -71,8 +89,6 @@
 }
 #endif
 
-#define NLENGTH(dirent) (strlen((dirent)->d_name))
-
 extern "C"
 {
 #if defined (HAVE_TERMIOS_H)
@@ -261,7 +277,9 @@
 
 	s.c_lflag &= ~(ICANON|ECHO|ECHOE|ECHOK|ECHONL);
 	s.c_oflag |=  (OPOST|ONLCR);
+#if ! defined (NeXT)
 	s.c_oflag &= ~(OCRNL|ONOCR|ONLRET);
+#endif
 	s.c_cc[VMIN] = 1;
 	s.c_cc[VTIME] = 0;
       }      
@@ -294,7 +312,9 @@
 
 	s.c_lflag &= ~(ICANON|ECHO|ECHOE|ECHOK|ECHONL);
 	s.c_oflag |=  (OPOST|ONLCR);
+#if ! defined (NeXT)
 	s.c_oflag &= ~(OCRNL|ONOCR|ONLRET);
+#endif
 	s.c_cc[VMIN] = 1;
 	s.c_cc[VTIME] = 0;
       }