That way, the code declares only the vars that it needs.
* s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
* s/cygwin.h (PTY_ITERATION): Likewise.
* s/darwin.h (PTY_ITERATION): Likewise.
* s/gnu-linux.h (PTY_ITERATION): Likewise.
2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
+ * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
+ That way, the code declares only the vars that it needs.
+ * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
+ * s/cygwin.h (PTY_ITERATION): Likewise.
+ * s/darwin.h (PTY_ITERATION): Likewise.
+ * s/gnu-linux.h (PTY_ITERATION): Likewise.
+
* s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
* process.c (allocate_pty): Don't declare stb unless it's needed.
static int
allocate_pty (void)
{
- register int c, i;
int fd;
#ifdef PTY_ITERATION
PTY_ITERATION
#else
+ register int c, i;
for (c = FIRST_PTY_LETTER; c <= 'z'; c++)
for (i = 0; i < 16; i++)
#endif
/* In AIX, you allocate a pty by opening /dev/ptc to get the master side.
To get the name of the slave side, you just ttyname() the master side. */
-#define PTY_ITERATION for (c = 0; !c ; c++)
+#define PTY_ITERATION int c; for (c = 0; !c ; c++)
#define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptc");
#define PTY_TTY_NAME_SPRINTF strcpy (pty_name, ttyname (fd));
/* Define HAVE_PTYS if the system supports pty devices. */
#define HAVE_PTYS
-#define PTY_ITERATION for (i = 0; i < 1; i++) /* ick */
+#define PTY_ITERATION int i; for (i = 0; i < 1; i++) /* ick */
#define PTY_NAME_SPRINTF /* none */
#define PTY_TTY_NAME_SPRINTF /* none */
#define PTY_OPEN \
/* Send signals to subprocesses by "typing" special chars at them. */
#define SIGNALS_VIA_CHARACTERS
-
Note: PTYs are broken on darwin <6. Use at your own risk. */
#define HAVE_PTYS
/* Run only once. We need a `for'-loop because the code uses `continue'. */
-#define PTY_ITERATION for (i = 0; i < 1; i++)
+#define PTY_ITERATION int i; for (i = 0; i < 1; i++)
#define PTY_NAME_SPRINTF /* none */
#define PTY_TTY_NAME_SPRINTF /* none */
/* Note that openpty may fork via grantpt on Mac OS X 10.4/Darwin 8.
/* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method for marking the stack. */
#define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
-
#define UNIX98_PTYS
/* Run only once. We need a `for'-loop because the code uses `continue'. */
-#define PTY_ITERATION for (i = 0; i < 1; i++)
+#define PTY_ITERATION int i; for (i = 0; i < 1; i++)
#ifdef HAVE_GETPT
#define PTY_NAME_SPRINTF