]> git.pld-linux.org Git - packages/vsxu.git/commit
avoid name conflict with C++17; rel 2 master auto/th/vsxu-0.6.3-2
authorJan Palus <atler@pld-linux.org>
Thu, 17 Jun 2021 09:14:14 +0000 (11:14 +0200)
committerJan Palus <atler@pld-linux.org>
Thu, 17 Jun 2021 09:14:14 +0000 (11:14 +0200)
commitb06f1cbd7068213b124f872cd249c8e6a2b5dae9
tree1fe7ae4f2dd06f1bb8d54be2bec88691d90b5ecd
parent5909ca89f5cc91c6dcc3d4176957aac2da94585d
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 [new file with mode: 0644]
vsxu.spec
This page took 0.071808 seconds and 4 git commands to generate.