platformio / platform-atmelsam

Atmel SAM: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/atmelsam
Apache License 2.0
79 stars 107 forks source link

Compiling a C++ sketch for Arduino DUE gives syntax errors #62

Closed ghost closed 5 years ago

ghost commented 5 years ago

I tried to compile a previously working Arduino DUE sketch with the latest 'atmelsam' updates from PlatformIO (latest version).. but syntax errors pop out when compiling, all regarding #define Max(a,b) (((a) > (b)) ? (a) : (b)) from the library source files: Expected unqualified-id before '(' token The macro itself is correct, and I also found out that removing any occurrence of std::map in my code removes the errors... is there a solution for this issue? Thanks in advance Lorenzo image

valeros commented 5 years ago

Does it work with the previous version of the platform?

ghost commented 5 years ago

No, It doesn't. Attempting to use std::map causes the above messages to appear. I tried to wrap all std::map members in conditional precompiler blocks as a test, and it seems that removing the std::maps from the code this way allows me to compile the sketch with no errors...

valeros commented 5 years ago

Hmm, I couldn't reproduce the issue. Could you put together a minimal example?

ivankravets commented 5 years ago

Please reopen if you still need help