fix generic termios.h macro exposure/namespace issues

add EXTA, EXTB, CIBAUD, CMSPAR, XCASE macros and hide them as well as
CBAUD, ECHOCTL, ECHOPRT, ECHOKE, FLUSHO, PENDIN in standard mode.

the new macros are both in glibc termios.h and in linux asm/termbits.h,
the later also contains IBSHIFT and BOTHER, those were not added.

these are not standard macros, but some of them are in the reserved
namespace so could be exposed, the ones which are not reserved are
CIBAUD, CMSPAR and XCASE (which was removed in issue 6), the rest
got hidden to be consistent with glibc.
This commit is contained in:
Szabolcs Nagy 2016-07-03 17:07:56 +02:00 committed by Rich Felker
parent 126f58b2f4
commit 2e128574c9
1 changed files with 14 additions and 9 deletions

View File

@ -109,8 +109,6 @@ struct termios
#define B3500000 0010016 #define B3500000 0010016
#define B4000000 0010017 #define B4000000 0010017
#define CBAUD 0010017
#define CSIZE 0000060 #define CSIZE 0000060
#define CS5 0000000 #define CS5 0000000
#define CS6 0000020 #define CS6 0000020
@ -133,12 +131,6 @@ struct termios
#define TOSTOP 0000400 #define TOSTOP 0000400
#define IEXTEN 0100000 #define IEXTEN 0100000
#define ECHOCTL 0001000
#define ECHOPRT 0002000
#define ECHOKE 0004000
#define FLUSHO 0010000
#define PENDIN 0040000
#define TCOOFF 0 #define TCOOFF 0
#define TCOON 1 #define TCOON 1
#define TCIOFF 2 #define TCIOFF 2
@ -153,8 +145,21 @@ struct termios
#define TCSAFLUSH 2 #define TCSAFLUSH 2
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define EXTA 0000016
#define EXTB 0000017
#define CBAUD 0010017
#define CBAUDEX 0010000 #define CBAUDEX 0010000
#define CRTSCTS 020000000000 #define CIBAUD 002003600000
#define CMSPAR 010000000000
#define CRTSCTS 020000000000
#define XCASE 0000004
#define ECHOCTL 0001000
#define ECHOPRT 0002000
#define ECHOKE 0004000
#define FLUSHO 0010000
#define PENDIN 0040000
#define EXTPROC 0200000 #define EXTPROC 0200000
#define XTABS 0014000 #define XTABS 0014000
#endif #endif