summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/include/sys/termios.h10
-rw-r--r--winsup/cygwin/termios.cc4
3 files changed, 15 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 0ffe94bda..fad41419f 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2011-01-11 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
+
+ * termios.cc (cfgetospeed, cfgetispeed): Constify argument per POSIX.
+ * include/sys/termios.h (cfgetospeed, cfgetispeed): Declare functions.
+ Move macros after declarations and make conditional on !__cplusplus.
+
2011-01-11 Corinna Vinschen <corinna@vinschen.de>
* cygtls.cc (_cygtls::init_thread): Call _REENT_INIT_PTR. Drop setting
diff --git a/winsup/cygwin/include/sys/termios.h b/winsup/cygwin/include/sys/termios.h
index 974a67404..9ae2c51a7 100644
--- a/winsup/cygwin/include/sys/termios.h
+++ b/winsup/cygwin/include/sys/termios.h
@@ -317,9 +317,6 @@ struct termios
#define termio termios
-#define cfgetospeed(tp) ((tp)->c_ospeed)
-#define cfgetispeed(tp) ((tp)->c_ispeed)
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -331,6 +328,8 @@ int tcdrain (int);
int tcflush (int, int);
int tcflow (int, int);
void cfmakeraw (struct termios *);
+speed_t cfgetispeed(const struct termios *);
+speed_t cfgetospeed(const struct termios *);
int cfsetispeed (struct termios *, speed_t);
int cfsetospeed (struct termios *, speed_t);
@@ -338,6 +337,11 @@ int cfsetospeed (struct termios *, speed_t);
}
#endif
+#ifndef __cplusplus
+#define cfgetispeed(tp) ((tp)->c_ispeed)
+#define cfgetospeed(tp) ((tp)->c_ospeed)
+#endif
+
/* Extra stuff to make porting stuff easier. */
struct winsize
{
diff --git a/winsup/cygwin/termios.cc b/winsup/cygwin/termios.cc
index 0aa062300..13ef7c0ac 100644
--- a/winsup/cygwin/termios.cc
+++ b/winsup/cygwin/termios.cc
@@ -232,14 +232,14 @@ tcsetpgrp (int fd, pid_t pgid)
/* cfgetospeed: POSIX96 7.1.3.1 */
extern "C" speed_t
-cfgetospeed (struct termios *tp)
+cfgetospeed (const struct termios *tp)
{
return __tonew_termios (tp)->c_ospeed;
}
/* cfgetispeed: POSIX96 7.1.3.1 */
extern "C" speed_t
-cfgetispeed (struct termios *tp)
+cfgetispeed (const struct termios *tp)
{
return __tonew_termios (tp)->c_ispeed;
}