Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dedbebf

Browse files
committed
Add more protection around the VSWTC/VSWTCH, CRTSCTS, and XTABS symbols;
these can be missing on some (all?) Irix and Tru64 versions. Protect the CRTSCTS value with a cast; this can be a larger value on Solaris/SPARC. This should fix SF tracker items #405092, #405350, and #405355.
1 parent 9089b27 commit dedbebf

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

Modules/termios.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,9 @@ static struct constant {
391391
{"TAB1", TAB1},
392392
{"TAB2", TAB2},
393393
{"TAB3", TAB3},
394+
#ifdef XTABS
394395
{"XTABS", XTABS},
396+
#endif
395397
{"BS0", BS0},
396398
{"BS1", BS1},
397399
{"VT0", VT0},
@@ -410,7 +412,9 @@ static struct constant {
410412
#ifdef CIBAUD
411413
{"CIBAUD", CIBAUD},
412414
#endif
413-
{"CRTSCTS", CRTSCTS},
415+
#ifdef CRTSCTS
416+
{"CRTSCTS", (long)CRTSCTS},
417+
#endif
414418

415419
/* struct termios.c_cflag-related values (character size) */
416420
{"CS5", CS5},
@@ -449,8 +453,12 @@ static struct constant {
449453
{"VEOF", VEOF},
450454
{"VTIME", VTIME},
451455
{"VMIN", VMIN},
456+
#ifdef VSWTC
457+
/* The #defines above ensure that if either is defined, both are,
458+
* but both may be omitted by the system headers. ;-( */
452459
{"VSWTC", VSWTC},
453460
{"VSWTCH", VSWTCH},
461+
#endif
454462
{"VSTART", VSTART},
455463
{"VSTOP", VSTOP},
456464
{"VSUSP", VSUSP},

0 commit comments

Comments
 (0)