Suggestion for better compiler/OS support on linux/unix

4 years 2 months ago - 4 years 2 months ago #29534478 by vector
As I was building your API into my application, I was having undefined reference errors on several methods that were in the RoboteqDevice.cpp file. Even though I was using the GNU compiler, linux was not defined. I would like to suggest changing all the lines like this:
#ifdef linux

To this:
#ifdef __unix__

Nearly all compilers support this for cross platform development. Alternatively, you can try chasing all the various forms of linux or __linux or __linux__ or even the upper case variants of those.

Also, in RoboteqDevice.cpp, eliminate compiler warnings and make the code slightly more readable by adding parenthesis around the bitwise operators in changing line 387 from:
fcntl(handle, F_SETFL, O_APPEND | O_NONBLOCK & ~FNDELAY);

To
fcntl(handle, F_SETFL, O_APPEND | (O_NONBLOCK & ~FNDELAY));

The last compiler warning involves "i" as an unused variable on line 492 which can simply be removed.

Please Log in or Create an account to join the conversation.

4 years 2 months ago #29534479 by Gabriel_Isko
We'll take this into consideration. Perhaps this will convince my team to start hosting this thing on github where you could just submit an issue.

Please Log in or Create an account to join the conversation.

4 years 2 months ago #29534481 by vector
Well, that would be nice. Between that and the other bug with the sleepms function that seemed to make it's way into 2.0, you'd be pretty well off :)

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 0.081 seconds