diff options
-rw-r--r-- | System/Posix/Terminal/Common.hsc | 12 | ||||
-rw-r--r-- | changelog.md | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/System/Posix/Terminal/Common.hsc b/System/Posix/Terminal/Common.hsc index 2f6327a..49418f5 100644 --- a/System/Posix/Terminal/Common.hsc +++ b/System/Posix/Terminal/Common.hsc @@ -527,8 +527,16 @@ baud2Word B4800 = (#const B4800) baud2Word B9600 = (#const B9600) baud2Word B19200 = (#const B19200) baud2Word B38400 = (#const B38400) +#ifdef B57600 baud2Word B57600 = (#const B57600) +#else +baud2Word B57600 = error "B57600 not available on this system" +#endif +#ifdef B115200 baud2Word B115200 = (#const B115200) +#else +baud2Word B115200 = error "B115200 not available on this system" +#endif -- And convert a word back to a baud rate -- We really need some cpp macros here. @@ -551,8 +559,12 @@ word2Baud x = else if x == (#const B9600) then B9600 else if x == (#const B19200) then B19200 else if x == (#const B38400) then B38400 +#ifdef B57600 else if x == (#const B57600) then B57600 +#endif +#ifdef B115200 else if x == (#const B115200) then B115200 +#endif else error "unknown baud rate" -- Clear termios i_flag diff --git a/changelog.md b/changelog.md index c3d43df..0f69383 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,8 @@ * Don't assume non-POSIX `WCOREDUMP(x)` macro exists + * Don't assume existence of termios constants beyond `B38400` + ## 2.7.1.0 *Dec 2014* * Bundled with GHC 7.10.1 |