From 6a7a2f4bbe6f231892df398f40c6293546e7c0c2 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 28 Feb 2006 01:31:04 +0000 Subject: [PATCH] * include/sys/termios.h (cfsetispeed): Just define as a function rather than resorting to a macro. (cfsetospeed): Ditto. --- winsup/cygwin/ChangeLog | 6 ++++ winsup/cygwin/include/sys/termios.h | 44 +++++++++++++++-------------- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 326205d29..e4193da18 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2006-02-27 Christopher Faylor + + * include/sys/termios.h (cfsetispeed): Just define as a function rather + than resorting to a macro. + (cfsetospeed): Ditto. + 2006-02-27 Christopher Faylor * sigproc.cc: Fix a comment. diff --git a/winsup/cygwin/include/sys/termios.h b/winsup/cygwin/include/sys/termios.h index 589c91a57..51e31ac0a 100644 --- a/winsup/cygwin/include/sys/termios.h +++ b/winsup/cygwin/include/sys/termios.h @@ -1,6 +1,6 @@ /* sys/termios.h - Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 Red Hat, Inc. + Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006 Red Hat, Inc. This file is part of Cygwin. @@ -234,26 +234,28 @@ typedef unsigned int speed_t; typedef unsigned short otcflag_t; typedef unsigned char ospeed_t; -struct __oldtermios { - otcflag_t c_iflag; - otcflag_t c_oflag; - otcflag_t c_cflag; - otcflag_t c_lflag; - char c_line; - cc_t c_cc[NCCS]; - ospeed_t c_ispeed; - ospeed_t c_ospeed; +struct __oldtermios +{ + otcflag_t c_iflag; + otcflag_t c_oflag; + otcflag_t c_cflag; + otcflag_t c_lflag; + char c_line; + cc_t c_cc[NCCS]; + ospeed_t c_ispeed; + ospeed_t c_ospeed; }; -struct termios { - tcflag_t c_iflag; - tcflag_t c_oflag; - tcflag_t c_cflag; - tcflag_t c_lflag; - char c_line; - cc_t c_cc[NCCS]; - speed_t c_ispeed; - speed_t c_ospeed; +struct termios +{ + tcflag_t c_iflag; + tcflag_t c_oflag; + tcflag_t c_cflag; + tcflag_t c_lflag; + char c_line; + cc_t c_cc[NCCS]; + speed_t c_ispeed; + speed_t c_ospeed; }; #ifdef CYGWIN_VERSION_DLL_IS_OLD_TERMIOS @@ -307,8 +309,6 @@ struct termios { #define cfgetospeed(tp) ((tp)->c_ospeed) #define cfgetispeed(tp) ((tp)->c_ispeed) -#define cfsetospeed(tp,s) (((tp)->c_ospeed = (s)), 0) -#define cfsetispeed(tp,s) (((tp)->c_ispeed = (s)), 0) #ifdef __cplusplus extern "C" { @@ -320,6 +320,8 @@ int tcsendbreak (int, int); int tcdrain (int); int tcflush (int, int); int tcflow (int, int); +int cfsetispeed (struct termios *, speed_t); +int cfsetospeed (struct termios *, speed_t); #ifdef __cplusplus }