khoih-prog / EthernetWebServer

This is simple yet complete WebServer library for AVR, AVR Dx, Portenta_H7, Teensy, SAM DUE, SAMD21/SAMD51, nRF52, STM32, RP2040-based, etc. boards running Ethernet shields. The functions are similar and compatible to ESP8266/ESP32 WebServer libraries to make life much easier to port sketches from ESP8266/ESP32. Coexisting now with `ESP32 WebServer` and `ESP8266 ESP8266WebServer` libraries. Ethernet_Generic library is used as default for W5x00 with custom SPI
MIT License
178 stars 49 forks source link

Break of min and max functions on Arduino Sam Due #12

Closed spangher closed 3 years ago

spangher commented 3 years ago

Hi, I'm trying to use you library but after adding it to my project I get an error on min and max functions that was previous inside my code. Before adding your library everything works well. I've patched platform.txt for SAM Due, as you said. I'm using also EthernetENC. Is It my fault? I forgot to patch something? To make my code working again I've to put this definitions after including your library:

ifndef max

define max(a,b) (((a) > (b)) ? (a) : (b))

endif

ifndef min

define min(a,b) (((a) < (b)) ? (a) : (b))

endif

Thanks, Paolo

khoih-prog commented 3 years ago

Thanks for using the library and it's good that you've found out a way to fix the problem. I also think that it's not your fault at all. There are too many libraries now, and each one will try to dictate the environment and conflicts will finally arise.

Without the Minimum Reproducible Code, it's difficult for anybody to guess what is going on with your code and which library introduces the issue.

It's helpful for other users to use your solution if getting the same issue. That's the way you, with your feedback,can contribute back to the Open Source Community.

Regards,