espressif / esp-protocols

Collection of ESP-IDF components related to networking protocols
195 stars 133 forks source link

Asio conflict with Arduino-esp32, because the Macro IPADDR_NONE (IDFGH-13808) #668

Open AI-Tipto opened 1 month ago

AI-Tipto commented 1 month ago

IDF: esp-idf v5.3.1 dependencies: espressif/arduino-esp32: "^3.1.0-rc1" espressif/asio: "^1.28.2"

Answers checklist.

General issue report

D:/espressif/esp/v5.3.1/esp-idf/components/lwip/lwip/src/include/lwip/ip4_addr.h:63:37: error: expected ')' before numeric constant 63 | #define IPADDR_NONE ((u32_t)0xffffffffUL) | ~ ^~~~ D:/espressif/esp/v5.3.1/esp-idf/components/lwip/lwip/src/include/lwip/inet.h:71:29: note: in expansion of macro 'IPADDR_NONE' 71 | #define INADDR_NONE IPADDR_NONE
| ^~~
D:/app/asio_test/components/arduino-esp32/cores/esp32/IPAddress.h:137:24: note: in expansion of macro 'INADDR_NONE' 137 | extern const IPAddress INADDR_NONE;

AI-Tipto commented 1 month ago

add `#ifdef INADDR_NONE

undef INADDR_NONE

endif`

after #include "asio.hpp" before use Arduino library , can compile.