Closed isnotinvain closed 3 years ago
In the library and examples these functions are only used to clamp values to a valid range. Using std::
is not an option for Arduino due to its memory limitations. The upcoming library update contains a helper fucntion clamp
to take care of this and that's also where the Arduino / Raspberry Pi / others distinction will be made to prevent spreading complier directives throughout the code in order to keep it simple and readable.
ok sounds good, thanks!
Please reopen if the issue persists
Great, thanks! I'll back out my undefine
s and see how it goes
Filing this so I don't forget -- I'll try and send a PR with a fix soon.
I'm not a C++ expert but I did some googling after hitting some compiler errors when I tried to use
std::min
in a file that includesOPL2.h
and found that defining min/max macros is discouraged (for this reason).This workaround works:
I think probably
std::min
andstd::max
could be used instead, at least for raspberry pi. Or this macro could move to the relevant cpp files instead.