[packages/vsxu] avoid name conflict with C++17; rel 2

atler atler at pld-linux.org
Thu Jun 17 11:21:35 CEST 2021


commit b06f1cbd7068213b124f872cd249c8e6a2b5dae9
Author: Jan Palus <atler at pld-linux.org>
Date:   Thu Jun 17 11:14:14 2021 +0200

    avoid name conflict with C++17; rel 2
    
    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:

 vsxu-cxx17_conflict.patch | 12 ++++++++++++
 vsxu.spec                 |  4 +++-
 2 files changed, 15 insertions(+), 1 deletion(-)
---
diff --git a/vsxu.spec b/vsxu.spec
index eebbab4..db8159d 100644
--- a/vsxu.spec
+++ b/vsxu.spec
@@ -7,7 +7,7 @@ Summary:	VSXu Music Visualizer
 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
@@ -22,6 +22,7 @@ Patch5:		%{name}-system-lzham-lzma.patch
 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
@@ -105,6 +106,7 @@ Pliki nagłówkowe bibliotek VSXu.
 %patch6 -p1
 %patch7 -p1
 %patch8 -p1
+%patch9 -p1
 
 %build
 install -d build
diff --git a/vsxu-cxx17_conflict.patch b/vsxu-cxx17_conflict.patch
new file mode 100644
index 0000000..c8db17f
--- /dev/null
+++ b/vsxu-cxx17_conflict.patch
@@ -0,0 +1,12 @@
+--- 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) \
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/vsxu.git/commitdiff/b06f1cbd7068213b124f872cd249c8e6a2b5dae9



More information about the pld-cvs-commit mailing list