OSSLibraries / Arduino_MFRC522v2

https://osslibraries.github.io/Arduino_MFRC522v2/
GNU Lesser General Public License v2.1
100 stars 38 forks source link

Add a prefix to DEPRECATED to avoid conflit with newer esp32 arduino cores #40

Closed PBrunot closed 3 months ago

PBrunot commented 5 months ago
Q A
Bug fix? yes
New feature? no
Doc update? no
BC breaks? no
Deprecations? no
Fixed tickets #...

To avoid collision with esp32 / binary.h file DEPRECATED and compiler warnings I suggest adding a prefix MRFC_ to the define in this project.

See : https://github.com/espressif/arduino-esp32/blob/c16a325439fe5a8a3160701d9601634155bb1443/cores/esp32/binary.h#L28

Example warning with GCC 12:

In file included from C:/Users/pasca/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:41,
                 from .pio/libdeps/wokwi/RFID_MFRC522v2/src/MFRC522v2.h:18,
                 from .pio/libdeps/wokwi/RFID_MFRC522v2/src/MFRC522v2.cpp:2:
C:/Users/pasca/.platformio/packages/framework-arduinoespressif32/cores/esp32/binary.h:28: warning: "DEPRECATED" redefined
   28 | #define DEPRECATED(x) [[deprecated("use " #x " instead")]]
      |
In file included from .pio/libdeps/wokwi/RFID_MFRC522v2/src/MFRC522v2.h:13: .pio/libdeps/wokwi/RFID_MFRC522v2/src/deprecated.h:12: note: this is the location of the previous definition
   12 | #define DEPRECATED [[deprecated]]
      |
Rotzbua commented 5 months ago

Thanks for the hint. I have not tested arduino-esp v3 yet. Added to my todo.

Rotzbua commented 3 months ago

@PBrunot thanks. fixed by 5b5f5b7d00f2f69906ce647f50082492c2fcba54