MusicPlayerDaemon / MPD

Music Player Daemon
https://www.musicpd.org/
GNU General Public License v2.0
2.11k stars 338 forks source link

event/TimerList: Add custom compare for android #2020

Closed DDRBoxman closed 2 months ago

DDRBoxman commented 2 months ago

NDK doesn't seem to support using std::compare_three_way for time_point so this implements that.

DDRBoxman commented 2 months ago

Interesting looks like macOS is failing on std::compare_three_way missing too 🤔

MaxKellermann commented 2 months ago

Interesting looks like macOS is failing on std::compare_three_way missing too 🤔

It's because both Android NDK and macOS ship with an outdated libc++ version which didn't implement this part of C++20.

I don't like this PR because it adds code noise to all platforms, even those that are standards-compliant. At least this should be #ifed and come with a proper explanatory comment. But I guess we could just as well wait for NDK r27 which should be here any day now.

(I don't care for macOS. It's a broken platform with a broken toolchain.)

DDRBoxman commented 2 months ago

I'm fine with waiting for r27 instead

MaxKellermann commented 2 months ago

r27-beta1 is out: https://dl.google.com/android/repository/android-ndk-r27-beta1-linux.zip (I havn't yet tested whether this release fixes the libc++ bug.)

MaxKellermann commented 2 months ago

Now tested. NDK r27-beta1 has the fix for this C++20 bug.