From: Sebastian Huber <sebastian.huber@embedded-brains.de>
To: newlib@sourceware.org
Subject: [PATCH] Use __BSD_VISIBLE for RTEMS <sys/_termios.h>
Date: Tue, 23 May 2017 08:23:00 -0000 [thread overview]
Message-ID: <20170523082353.1793-1-sebastian.huber@embedded-brains.de> (raw)
The Termios header <sys/_termios.h> used _POSIX_SOURCE directly to
determine if a thing should be exposed to the user. This circumvented
the feature mechanisms of <sys/cdefs.h>.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
---
newlib/libc/sys/rtems/include/sys/_termios.h | 46 ++++++++++++++--------------
1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/newlib/libc/sys/rtems/include/sys/_termios.h b/newlib/libc/sys/rtems/include/sys/_termios.h
index c8fe054da..2e7cc36c2 100644
--- a/newlib/libc/sys/rtems/include/sys/_termios.h
+++ b/newlib/libc/sys/rtems/include/sys/_termios.h
@@ -42,15 +42,15 @@
*/
#define VEOF 0 /* ICANON */
#define VEOL 1 /* ICANON */
-#ifndef _POSIX_SOURCE
+#if __BSD_VISIBLE
#define VEOL2 2 /* ICANON together with IEXTEN */
#endif
#define VERASE 3 /* ICANON */
-#ifndef _POSIX_SOURCE
+#if __BSD_VISIBLE
#define VWERASE 4 /* ICANON together with IEXTEN */
#endif
#define VKILL 5 /* ICANON */
-#ifndef _POSIX_SOURCE
+#if __BSD_VISIBLE
#define VREPRINT 6 /* ICANON together with IEXTEN */
#define VERASE2 7 /* ICANON */
#endif
@@ -58,18 +58,18 @@
#define VINTR 8 /* ISIG */
#define VQUIT 9 /* ISIG */
#define VSUSP 10 /* ISIG */
-#ifndef _POSIX_SOURCE
+#if __BSD_VISIBLE
#define VDSUSP 11 /* ISIG together with IEXTEN */
#endif
#define VSTART 12 /* IXON, IXOFF */
#define VSTOP 13 /* IXON, IXOFF */
-#ifndef _POSIX_SOURCE
+#if __BSD_VISIBLE
#define VLNEXT 14 /* IEXTEN */
#define VDISCARD 15 /* IEXTEN */
#endif
#define VMIN 16 /* !ICANON */
#define VTIME 17 /* !ICANON */
-#ifndef _POSIX_SOURCE
+#if __BSD_VISIBLE
#define VSTATUS 18 /* ICANON together with IEXTEN */
/* 19 spare 2 */
#endif
@@ -91,16 +91,16 @@
#define ICRNL 0x00000100 /* map CR to NL (ala CRMOD) */
#define IXON 0x00000200 /* enable output flow control */
#define IXOFF 0x00000400 /* enable input flow control */
-#ifndef _POSIX_SOURCE
+#if __BSD_VISIBLE
#define IXANY 0x00000800 /* any char will restart after stop */
#define IMAXBEL 0x00002000 /* ring bell on input queue full */
-#endif /*_POSIX_SOURCE */
+#endif
/*
* Output flags - software output processing
*/
#define OPOST 0x00000001 /* enable following output processing */
-#ifndef _POSIX_SOURCE
+#if __BSD_VISIBLE
#define ONLCR 0x00000002 /* map NL to CR-NL (ala CRMOD) */
#define TABDLY 0x00000004 /* tab delay mask */
#define TAB0 0x00000000 /* no tab delay and expansion */
@@ -109,12 +109,12 @@
#define OCRNL 0x00000010 /* map CR to NL on output */
#define ONOCR 0x00000020 /* no CR output at column 0 */
#define ONLRET 0x00000040 /* NL performs CR function */
-#endif /*_POSIX_SOURCE */
+#endif /* __BSD_VISIBLE */
/*
* Control flags - hardware control of terminal
*/
-#ifndef _POSIX_SOURCE
+#if __BSD_VISIBLE
#define CIGNORE 0x00000001 /* ignore control flags */
#endif
#define CSIZE 0x00000300 /* character size mask */
@@ -128,14 +128,14 @@
#define PARODD 0x00002000 /* odd parity, else even */
#define HUPCL 0x00004000 /* hang up on last close */
#define CLOCAL 0x00008000 /* ignore modem status lines */
-#ifndef _POSIX_SOURCE
+#if __BSD_VISIBLE
#define CCTS_OFLOW 0x00010000 /* CTS flow control of output */
#define CRTSCTS (CCTS_OFLOW | CRTS_IFLOW)
#define CRTS_IFLOW 0x00020000 /* RTS flow control of input */
#define CDTR_IFLOW 0x00040000 /* DTR flow control of input */
#define CDSR_OFLOW 0x00080000 /* DSR flow control of output */
#define CCAR_OFLOW 0x00100000 /* DCD flow control of output */
-#endif
+#endif /* __BSD_VISIBLE */
/*
@@ -146,30 +146,30 @@
* input flag.
*/
-#ifndef _POSIX_SOURCE
+#if __BSD_VISIBLE
#define ECHOKE 0x00000001 /* visual erase for line kill */
-#endif /*_POSIX_SOURCE */
+#endif
#define ECHOE 0x00000002 /* visually erase chars */
#define ECHOK 0x00000004 /* echo NL after line kill */
#define ECHO 0x00000008 /* enable echoing */
#define ECHONL 0x00000010 /* echo NL even if ECHO is off */
-#ifndef _POSIX_SOURCE
+#if __BSD_VISIBLE
#define ECHOPRT 0x00000020 /* visual erase mode for hardcopy */
#define ECHOCTL 0x00000040 /* echo control chars as ^(Char) */
-#endif /*_POSIX_SOURCE */
+#endif
#define ISIG 0x00000080 /* enable signals INTR, QUIT, [D]SUSP */
#define ICANON 0x00000100 /* canonicalize input lines */
-#ifndef _POSIX_SOURCE
+#if __BSD_VISIBLE
#define ALTWERASE 0x00000200 /* use alternate WERASE algorithm */
-#endif /*_POSIX_SOURCE */
+#endif
#define IEXTEN 0x00000400 /* enable DISCARD and LNEXT */
#define EXTPROC 0x00000800 /* external processing */
#define TOSTOP 0x00400000 /* stop background jobs from output */
-#ifndef _POSIX_SOURCE
+#if __BSD_VISIBLE
#define FLUSHO 0x00800000 /* output being flushed (state) */
#define NOKERNINFO 0x02000000 /* no kernel output from VSTATUS */
#define PENDIN 0x20000000 /* XXX retype pending input (state) */
-#endif /*_POSIX_SOURCE */
+#endif
#define NOFLSH 0x80000000 /* don't flush after interrupt */
/*
@@ -191,7 +191,7 @@
#define B9600 9600
#define B19200 19200
#define B38400 38400
-#ifndef _POSIX_SOURCE
+#if __BSD_VISIBLE
#define B7200 7200
#define B14400 14400
#define B28800 28800
@@ -203,7 +203,7 @@
#define B921600 921600
#define EXTA 19200
#define EXTB 38400
-#endif /* !_POSIX_SOURCE */
+#endif /* __BSD_VISIBLE */
typedef unsigned int tcflag_t;
typedef unsigned char cc_t;
--
2.12.0
next reply other threads:[~2017-05-23 8:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-23 8:23 Sebastian Huber [this message]
2017-05-23 15:16 ` Craig Howland
2017-05-23 21:20 ` Yaakov Selkowitz
2017-05-24 5:42 ` Sebastian Huber
2017-05-24 9:29 ` Sebastian Huber
2017-05-24 14:51 ` Craig Howland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170523082353.1793-1-sebastian.huber@embedded-brains.de \
--to=sebastian.huber@embedded-brains.de \
--cc=newlib@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).