[comp.emacs] Bug in Gnu Emacs 18.52 on 3b2

dwp@mtune.ATT.COM (David Preisler) (12/15/88)

While trying to install GnuEmacs 18.52 on a 3b2 700 running Unix V 3.2.1
with "s-usg5-3.h" and "m-att3b.h" defined in config.h encountered a series 
of syntax errors in src/sysdep.c: i.e. ws_row and ws_col undefined.

Solution: In file src/sysdep.c in the #ifdef HAVE_TERMIO definition you 
*must* #undef TIOCGWINSZ.

Fix goes in this segment:

          >   #ifdef HAVE_TERMIO
          >   #include <sys/termio.h>
          >   #undef TIOCGETP
          >   #define TIOCGETP TCGETA
          >   #undef TIOCSETN
          >   #define TIOCSETN TCSETA
          >   #undef TIOCSETP
          >   #define TIOCSETP TCSETAF
          >   #define TERMINAL struct termio
          >   #define OSPEED(str) (str.c_cflag & CBAUD)
          >   #define OSPEED(str) (str.c_cflag & CBAUD)
          >   #define SETOSPEED(str,new) (str.c_cflag = (str.c_cfl > [more]
          >   #define TABS_OK(str) ((str.c_oflag & TABDLY) != TAB3)
Fix here: >   #undef TIOCGWINSZ
          >   #endif /* HAVE_TERMIO */


Without the fix TIOCGSZ is defined, but not the way we think it is 
so the below defs are never made when they should be

          >                          
          >   /* Define the 4.3 names in terms of the Sun names
          >      if the latter exist and the former do not.  */
          >   
          >   #ifdef TIOCGSIZE
          >   #ifndef TIOCGWINSZ
          >   #define TIOCGWINSZ TIOCGSIZE
          >   #define winsize ttysize
          >   #define ws_row ts_lines
          >   #define ws_col ts_cols
          >   #endif
          >   #endif /* Sun */
          >       
          
As a result of the 'confusion' about TIOCGWINSZ when we try to 
use ws_row/col ( and others ) we get sytax errors in the code 
segment below.
          
          >
          >   /* Do it using the 4.3 names if possible.  */
          >      #ifdef TIOCGWINSZ
          >     struct winsize size;
          >     *heightp = 0;
          >     if (ioctl (0, TIOCGWINSZ, &size) < 0)
          >       return;
          >     if ((unsigned) size.ws_col > MScreenWidth
          >         || (unsigned) size.ws_row > MScreenLength)
          >       return;
          >     *widthp = size.ws_col;
          >     *heightp = size.ws_row;
          >   #else /* not TIOCGWNSIZ */
          >   #ifdef VMS
          >     .....



Thanks to all those who responded!!!

David William Preisler                                
  System Administrator     

AT&T Bell Laboratories     Email: att!mtune!dwp.ATT.COM
     200 Laurel Avenue
Middletown,  NJ  07748     Phone: (201) 957-2594

ditto@cbmvax.UUCP (Michael "Ford" Ditto) (12/16/88)

In article <7885@mtune.ATT.COM> dwp@mtune.ATT.COM (David Preisler) writes:
>While trying to install GnuEmacs 18.52 on a 3b2 700 running Unix V 3.2.1
>with "s-usg5-3.h" and "m-att3b.h" defined in config.h encountered a series 
>of syntax errors in src/sysdep.c: i.e. ws_row and ws_col undefined.
>
>Solution: In file src/sysdep.c in the #ifdef HAVE_TERMIO definition you 
>*must* #undef TIOCGWINSZ.

If it's only the m-att3b machines that have the bogus TIOCGWINSZ, the
#undef should be in "m-att3b.h".  The proposed fix prevents TIOCGWINSZ
from working on ANY SysV machine (and I beleive there are some SysV's
that have TIOCGWINSZ).
-- 
					-=] Ford [=-

"The number of Unix installations	(In Real Life:  Mike Ditto)
has grown to 10, with more expected."	ford@kenobi.cts.com
- The Unix Programmer's Manual,		...!sdcsvax!crash!elgar!ford
  2nd Edition, June, 1972.		ditto@cbmvax.commodore.com