make operator new inline to avoid duplicates during linking#13
make operator new inline to avoid duplicates during linking#13domschl merged 1 commit intomuwerk:inlinefrom
Conversation
|
Which platform define did you use? Some arduino SDKs do define a |
|
Hi, I'm using platformio + Arduino nano, which does not have that operator defined. The issue is that if you have two cpp files (a.cpp and b.cpp) that both include functional.h you'll end up with two instances of that operator implementation causing a linker error. Defining that function inline prevents that. An alternative would be to just have the prototype in the header file and move the implementation to a c file. |
|
Hmm. That's a valid point. |
|
Unfortunately that hack does not work, as there is no definition of that function in Arduino.h or something. So then that implementation would exist but there is no header definition for that :/ |
|
I guess you're right, it's going to be |
|
Release 0.6.2 is published in platformio, thank you! |
|
Thank you very much, greatly appreciated! |
No description provided.