cmajor icon indicating copy to clipboard operation
cmajor copied to clipboard

Compiler error in generated C++ code when targeting certain platforms

Open JamesHallowell opened this issue 1 year ago • 1 comments

Hi,

I'm trying to compile the generated C++ code for a CMajor patch to run on a Daisy Seed, but hitting a compile error when it tries to call the max intrinsic in the code generated from std::smoothing::SmoothedValue::setTarget:

image

It appears on this platform int32_t is a long not an int. Is this something that could reasonably be accomodated for in the generated code? Potentially wrapping int32 constants like int32_t {1}? It appears something similiar is already in place for int64.

Thanks.

JamesHallowell avatar Aug 04 '24 15:08 JamesHallowell

Thanks for the feedback. I'll look to see what can be done about this.,

cesaref avatar Aug 05 '24 09:08 cesaref

I've gone with this suggestion. I had a look at a different option, to actually use specialisations but I think this is a better compromise. Let me know if it resolves your problem. A build hasn't been released, but it is an update to the source code for the c++ generator

cesaref avatar Aug 16 '24 23:08 cesaref

I've gone with this suggestion. I had a look at a different option, to actually use specialisations but I think this is a better compromise. Let me know if it resolves your problem. A build hasn't been released, but it is an update to the source code for the c++ generator

Thanks @cesaref, just tried that out and it works great! Much appreciated.

JamesHallowell avatar Aug 17 '24 09:08 JamesHallowell