wjwwood / serial

Cross-platform, Serial Port library written in C++
http://wjwwood.github.com/serial/
MIT License
2.11k stars 1.03k forks source link

Issue when used with ncurses. #203

Open Odog1996 opened 5 years ago

Odog1996 commented 5 years ago

Really random issue but when compiled through gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.11), serial/serial.h must be included in the program before ncurses.h otherwise the following build error occurs:

/usr/local/include/serial/serial.h:471:45: error: macro "timeout" passed 5 arguments, but takes just 1 write_timeout_multiplier);

HRex39 commented 3 years ago

I tried to skip the macro and just call the function like this:
serial/serial.h:471

Timeout (timeout)(inter_byte_timeout, read_timeout_constant,
                    read_timeout_multiplier, write_timeout_constant,
                    write_timeout_multiplier);
    return setTimeout(timeout);

The Package seems then compile successfully.