cesanta / mongoose-os

Mongoose OS - an IoT Firmware Development Framework. Supported microcontrollers: ESP32, ESP8266, CC3220, CC3200, STM32F4, STM32L4, STM32F7. Amazon AWS IoT, Microsoft Azure, Google IoT Core integrated. Code in C or JavaScript.
https://mongoose-os.com
Other
2.48k stars 430 forks source link

endian.h warning: "htons" redefined #562

Open Harvie opened 3 years ago

Harvie commented 3 years ago

Hello, when i include endian.h it gives me warning that htons() is already defined in lwip... i am not sure why this happens... is endian.h expected to cotain htons()? feels to me like it more belongs to lwip... is there some way to clean this up?

In file included from /opt/Espressif/esp-idf/components/lwip/lwip/src/include/lwip/ip_addr.h:41:0,
                 from common/platforms/lwip/mg_lwip.h:27,
                 from /home/harvie/Temp/firmware-github/deps/mongoose/include/mgos_mongoose.h:30,
                 from /mongoose-os/include/mgos.h:47,
                 from /home/harvie/Temp/firmware-github/src/test.cpp:7:
/opt/Espressif/esp-idf/components/lwip/lwip/src/include/lwip/def.h:108:0: warning: "htons" redefined
 #define htons(x) lwip_htons(x)
 ^
In file included from /home/harvie/Temp/firmware-github/src/test.cpp:6:0:
/opt/Espressif/esp-idf/components/wpa_supplicant/port/include/endian.h:103:0: note: this is the location of the previous definition
 #define htons htobe16
 ^