* 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

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