Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: pty device files.



In article <E12rn9y-0000b8-00@xxxxxxxxxxxxxxxxxx>,
  Zefram <zefram@xxxxxxxx> writes:

> >+#elif defined(__FreeBSD__)
> 
> Trivial point: #elif isn't portable enough for us (it's not in some
> K&R preprocessors).  Though I see one has crept into system.h.

I see.

Index: Src/Modules/zpty.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/zpty.c,v
retrieving revision 1.8
diff -u -r1.8 zpty.c
--- Src/Modules/zpty.c	2000/05/16 18:16:20	1.8
+++ Src/Modules/zpty.c	2000/05/17 03:40:01
@@ -213,16 +213,18 @@
 get_pty(int master, int *retfd)
 {
 
-#if defined(__linux)
+#ifdef __linux
     static char char1[] = "abcdefghijklmnopqrstuvwxyz";
     static char char2[] = "0123456789abcdef";
-#elif defined(__FreeBSD__)
+#else /* __linux */
+# ifdef __FreeBSD__
     static char char1[] = "pqrsPQRS";
     static char char2[] = "0123456789abcdefghijklmnopqrstuv";
-#else
+# else /* __FreeBSD__ */
     static char char1[] = "pqrstuvwxyzPQRST";
     static char char2[] = "0123456789abcdef";
-#endif
+# endif /* __FreeBSD__ */
+#endif /* __linux */
 
     static char name[11];
     static int mfd, sfd;
-- 
Tanaka Akira



Messages sorted by: Reverse Date, Date, Thread, Author