* 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.
This commit is contained in:
Corinna Vinschen 2011-01-11 10:09:23 +00:00
parent cd441f06e2
commit b7d4651e3e
3 changed files with 15 additions and 5 deletions

View File

@ -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

View File

@ -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
{

View File

@ -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;
}