Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: ILI9341_t3 swap() conflict

  1. #1

    ILI9341_t3 swap() conflict

    A swap(a,b) function is defined for ILI9341_t3.h and .cpp. This is wrapped by a #ifndef, and if encountered after another swap() declaration, should fall back to the previous. This seems to work fine under Windows and Linux, as long as the ILI9341_t3.h include is second. The Vector Network Analyzer project
    https://forum.pjrc.com/threads/41326...twork-Analyzer
    has a builder that cannot get the AVNA program RSL_VNA5.ino to compile under Mac OS-X. The errors say, I think, that std::vector library is encountering errors using the ILI9341_t3.h definition of swap().

    The std:vector is seen first, per the snippet
    Code:
    #include <vector>
     // swap() collision between ILI9341_t3 and vector.  A problem?  Order as shown stops
    #include <ILI9341_t3.h>
    but that does not seem to keep the order on the Mac.

    I changed the name swap to swap_t3 in the ILI9341_t3 files., and I think that fixes it. But, I assume it is undesirable to have different swap() definitions that are protected by the order they are encountered. My question: what is the correct way to solve the problem for everybody? (I can work with a private ILI9341 library, but that doesn't help others).

  2. #2
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,774
    I'd say rename it and do a pullrequest on Github(?!)

  3. #3
    Thanks, Frank. I will proceed on that path. Bob

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •