platformio / platform-atmelsam

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

Compiling error in USB_device.h #47

Closed ghost closed 5 years ago

ghost commented 5 years ago

When compiling a simple sketch in platformio with #include <Arduino.h> the following error comes up:

[...]\toolchain-gccarmnoneeabi\arm-none-eabi\include\c++\4.8.4\bits\basic_string.h: In member function 'int std::basic_string<_CharT, _Traits, _Alloc>::compare(const std::basic_string<_CharT, _Traits, _Alloc>&) const':
[...]\framework-arduinosam\system\sam\libsam/include/USB_device.h:364:25: error: expected unqualified-id before '(' token

#define Min(a, b)       (((a) < (b)) ?  (a) : (b))
^

The macro seems perfect and I never use it in my code, so what could have gone wrong?

ivankravets commented 5 years ago

Could you provide a simple PlatformIO project to reproduce this issue?

ghost commented 5 years ago

It now compiles! Perhaps it's a bug in VS Code?