From c9ffa22d4f50210c64e495c780ff6af812786d15 Mon Sep 17 00:00:00 2001 From: SheatNoisette Date: Sun, 16 Aug 2026 15:58:15 +0200 Subject: [PATCH] Fix matching function call for min On MacOS Clang, the line: ``` size_t count = std::min(pos + samples, Data.size()) - pos; ``` Fails with: ``` SurrealEngine/SurrealEngine/Video/VideoPlayer.cpp:41:18: error: no matching function for call to 'min' size_t count = std::min(pos + samples, Data.size()) - pos; ^~~~~~~~ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__algorithm/min.h:40:1: note: candidate template ignored: deduced conflicting types for parameter '_Tp' ('uint64_t' (aka 'unsigned long long') vs. 'size_type' (aka 'unsigned long')) min(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__algorithm/min.h:51:1: note: candidate template ignored: could not match 'initializer_list<_Tp>' against 'uint64_t' (aka 'unsigned long long') min(initializer_list<_Tp> __t, _Compare __comp) ``` So add a cast to std::min to please the compiler. --- SurrealEngine/Video/VideoPlayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SurrealEngine/Video/VideoPlayer.cpp b/SurrealEngine/Video/VideoPlayer.cpp index 608663e86..81e5f2fc4 100644 --- a/SurrealEngine/Video/VideoPlayer.cpp +++ b/SurrealEngine/Video/VideoPlayer.cpp @@ -37,7 +37,7 @@ class VideoAudioSource : public AudioSource size_t ReadSamples(float* output, size_t samples) override { - size_t count = std::min(pos + samples, Data.size()) - pos; + size_t count = std::min(pos + samples, Data.size()) - pos; int16_t* d = Data.data() + pos; for (size_t i = 0; i < count; i++) {