Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
luni64 opened this issue Jul 18, 2020 · 1 comment
Closed

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

luni64 opened this issue Jul 18, 2020 · 1 comment

Comments

@luni64
Copy link

luni64 commented Jul 18, 2020

#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)

ILI9341_t3/ILI9341_t3.h

Lines 555 to 559 in ff4bba3

#ifndef swap
#define swap(a, b) { typeof(a) t = a; a = b; b = t; }
#endif

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
Copy link
Owner

fixed by Kurt's PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants