lovyan03 / LovyanGFX

SPI LCD graphics library for ESP32 (ESP-IDF/ArduinoESP32) / ESP8266 (ArduinoESP8266) / SAMD51(Seeed ArduinoSAMD51)
Other
1.12k stars 200 forks source link

M5 official library's "Ghost Macro" kills std::min etc. #146

Closed 9PEO0xNd closed 2 years ago

9PEO0xNd commented 2 years ago

Dear, lovyan03-san, I'm M5Gray and M5Core2 user. Since I have updated lovyanGFX ver0.4.2 in my system, your sample code generates error in case M5 official library is included.

I know you and mentors saying twitter comments below: "SPRESENSEのArduinoの実装、Arduino.hにいきなり鬼畜マクロ定義されてて std::minやらstd::maxが即死なんじゃが…" "そもそもArduinoの標準としてminとかmaxとか独自実装な件。。。" Thus, most of users know work around and no one reports issues.

currently I'm doing work around like this: insert "#undef min" etc. right place in my code . Or using brackets (std::min) in your sample code zoom = (float)((std::min)(lcd.width(), lcd.height())) / width; Or include ESP32-Chimera-Core.h instead. これら直されますか?Twitter嫌いなのでこちらに投函したのをお許しください。

Best regards, 9PEO0xNd

lovyan03 commented 2 years ago

@9PEO0xNd Thanks for reporting this problem ! I've reflected the fix in the develop branch. If everything goes well, it will be included in the next release.

9PEO0xNd commented 2 years ago

Dear Lovyan03-san, Thanks anyways !