FabioBatSilva / ArduinoFake

Arduino mocking made easy
https://platformio.org/lib/show/1689/ArduinoFake
MIT License
105 stars 48 forks source link

avoid clashes with std::min and std:max from STL #15

Closed arduhe closed 4 years ago

arduhe commented 4 years ago

The definitions for min() and max in src/arduino/Arduino.h produce a lot of errors when using STL (for example with googletest) like this:

/usr/include/c++/7/limits:1002:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return __INT_MAX__; }
           ^
/usr/include/c++/7/limits:1006:38: error: macro "min" requires 2 arguments, but only 1 given
       lowest() noexcept { return min(); }
                                      ^

This minor patch avoids that.

Please accept this PR.

FabioBatSilva commented 4 years ago

Thanks @arduhe

arduhe commented 4 years ago

Thanks for your quick reaction. Could you please so kind to publish a new version of your lib?

FabioBatSilva commented 4 years ago

I released 0.2.2.

It might take a while to show up on platformio.. The last time a pushed one took almost 2 days