I've tried update the code to be a little more cleanly separated, and fixed the issue with BOOL. This code really just runs as an exception when a custom baudrate is requested. Otherwise, it pretty much shares the same code. If someone can suggest a better way to organize the code, I'd be happy to implement it.
(Sorry for the duplicate email, Nikolay, I forgot to replay all at first)
On 1 December 2014 at 02:21, Nikolay Sivov nsivov@codeweavers.com wrote:
On 11/29/2014 07:53 PM, Nathan Fearnley wrote:
Mac OS X supports a special function call for custom baud rates. I have implemented this feature to allow non-standard baud rates. Unfortunately, setting any other parameters using tcsetattr will fail, because it does not support the higher baud rates. In order to work around this, when setting other parameters, the baud rate is temporarily set to 9600, then reset back to custom rate after the changes are complete.
I can't comment on functional part, but regarding code structure this should be better separated imho. Maybe it's even better to duplicate whole functions and ifdef them all in case when __APPLE__ is not defined. Also don't use C++ 'bool', use BOOL with TRUE/FALSE defines.