PaulStoffregen / ILI9341_t3

Optimized ILI9341 TFT Library
http://pjrc.com/store/display_ili9341.html
241 stars 93 forks source link

swap clashes with c++ header <functional> #62

Closed luni64 closed 3 years ago

luni64 commented 3 years ago
#include "ILI9341_t3.h"
#include <functional>

void setup()
{
}

void loop()
{
}

Does not compile. However, including <functional> before the ILI header works.

The problem is the definition of the swap macro in ILI9341_t3.h which clashes with some definitions in <functional> (and possibly other standard c++ headers)

https://github.com/PaulStoffregen/ILI9341_t3/blob/ff4bba3e1500ac3a025e391f0cb7de84ad95e1ee/ILI9341_t3.h#L555-L559

Since the macro is not used in the header you might consider moving its definition to the cpp file to avoid name clashes with other headers.

Also see: https://forum.pjrc.com/threads/59112-TeensyTimerTool?p=246670&viewfull=1#post246670

PaulStoffregen commented 3 years ago

fixed by Kurt's PR