C++17 introduced new symbol "clamp" which conflicts with macro in vsxu's
public header. since projects might request C++17 explicitly or
implicitly (GCC 11 defaults to C++17) disable macro if compiled with
this or higher standard. in case there are users of clamp macro, it
should be either changed to std::clamp or equivalent CLAMP macro. note
there's no need to update vsxu codebase since it uses C++11.
fixes vlc build error:
/usr/include/c++/11.1.0/bits/algorithmfwd.h:229:55: error: macro "clamp" passed 4 arguments, but takes just 3
229 | clamp(const _Tp&, const _Tp&, const _Tp&, _Compare);
| ^
In file included from /usr/include/vsxu/common/vsx_argvector.h:37,
from /usr/include/vsxu/engine/audiovisual/vsx_state_manager.h:27,
from visualization/vsxu.cpp:45:
/usr/include/vsxu/common/math/vsx_math.h:53: note: macro "clamp" defined here
53 | #define clamp(N, L, U) (MAX(MIN((N), (U)), (L)))
|
In file included from /usr/include/c++/11.1.0/functional:65,
from /usr/include/vsxu/common/tools/vsx_thread_pool.h:10,
from /usr/include/vsxu/common/filesystem/archive/vsx_filesystem_archive_reader.h:7,
from /usr/include/vsxu/common/filesystem/vsx_filesystem.h:9,
from /usr/include/vsxu/common/string/vsx_string_helper.h:7,
from /usr/include/vsxu/common/vsx_argvector.h:50,
from /usr/include/vsxu/engine/audiovisual/vsx_state_manager.h:27,
from visualization/vsxu.cpp:45:
--- /dev/null
+--- vsxu-0.6.3.orig/lib/common/include/math/vsx_math.h 2018-11-11 12:44:03.000000000 +0100
++++ vsxu-0.6.3/lib/common/include/math/vsx_math.h 2021-06-17 10:55:18.670208881 +0200
+@@ -50,7 +50,9 @@
+
+ #define CLAMP(N, L, U) (MAX(MIN((N), (U)), (L)))
+
++#if __cplusplus <= 201402L
+ #define clamp(N, L, U) (MAX(MIN((N), (U)), (L)))
++#endif
+
+
+ #define DOUBLE_EQUALS(A, B) \
Summary(pl.UTF-8): VSXu - wizualizacja muzyki
Name: vsxu
Version: 0.6.3
-Release: 1
+Release: 2
License: GPL v3
Group: Libraries
#Source0Download: https://github.com/vovoid/vsxu/releases
Patch6: %{name}-system-cal3d.patch
Patch7: %{name}-format64.patch
Patch8: %{name}-pc.patch
+Patch9: %{name}-cxx17_conflict.patch
URL: http://www.vsxu.com/
BuildRequires: OpenGL-devel
BuildRequires: OpenGL-GLU-devel
%patch6 -p1
%patch7 -p1
%patch8 -p1
+%patch9 -p1
%build
install -d build