[vlc-commits] [Git][videolan/vlc][3.0.x] 5 commits: mkv: remove deprecated std function

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Sep 15 11:15:20 UTC 2022



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
f5e69654 by Alexandre Janniaux at 2022-09-13T18:38:34+03:00
mkv: remove deprecated std function

std::mem_fun and std::bind2nd have been deprecated in C++11 and will be
removed in C++17. They were replaced by std::mem_fn and std::bind which
are easier to use.

Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
(cherry picked from commit 6fce792e89c8f3879705d0fc52caa43f699d5393)
Signed-off-by: Martin Storsjö <martin at martin.st>

- - - - -
3076009b by Martin Storsjö at 2022-09-13T18:38:37+03:00
contrib: projectM: Force building with a specific older C++ version

This project uses std::auto_ptr, which was deprecated in C++11,
so stick to compiling in C++98 mode. (Either C++98, C++11 or
C++14 would work.)

This fixes building with newer compilers that default to C++17
if nothing is specified (which is the default since GCC 11
and Clang 16).

When building with Clang/libc++ 16 in C++17 mode, it fails with
errors like these:

<build>/projectM/Renderer/RenderItemDistanceMetric.hpp:20:46: error: no template named 'binary_function' in namespace 'std'; did you mean '__binary_function'?
class RenderItemDistanceMetric : public std::binary_function<const RenderItem*, const RenderItem*, double> {
                                        ~~~~~^~~~~~~~~~~~~~~

(The std::binary_function class is removed in C++17.)

(cherry picked from commit 3e29d7f67991e60c8830e3a551419f7b8663f4b3)
Signed-off-by: Martin Storsjö <martin at martin.st>

- - - - -
0637137a by Martin Storsjö at 2022-09-13T18:38:37+03:00
contrib: asdcplib: Force building with a specific older C++ version

This project uses the 'register' storage class specifier for a lot
of variables, and C++17 disallows that storage class spcifier.

This fixes building with newer compilers that default to C++17
if nothing is specified (which is the default since GCC 11
and Clang 16).

When building with Clang 16 in C++17 mode, it fails with errors
like these:

KM_util.cpp:357:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
  register byte_t c = 0, d = 0;
  ^~~~~~~~~

(cherry picked from commit fb8eb5edd26f856a1051b3b4525c0e6677aa2f32)
Signed-off-by: Martin Storsjö <martin at martin.st>

- - - - -
41cf40b1 by Martin Storsjö at 2022-09-13T18:38:37+03:00
contrib: modplug: Force building with a specific older C++ version

This project uses the 'register' storage class specifier for a lot
of variables, and C++17 disallows that storage class spcifier.

This fixes building with newer compilers that default to C++17
if nothing is specified (which is the default since GCC 11
and Clang 16).

When building with Clang 16 in C++17 mode, it fails with errors
like these:

fastmix.cpp:678:2: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
        SNDMIX_BEGINSAMPLELOOP8
        ^
fastmix.cpp:291:2: note: expanded from macro 'SNDMIX_BEGINSAMPLELOOP8'
        register MODCHANNEL * const pChn = pChannel;\
        ^

(cherry picked from commit 72e7335d664905331768728e4afff8134d2d3ac8)
Signed-off-by: Martin Storsjö <martin at martin.st>

- - - - -
01dd8180 by Martin Storsjö at 2022-09-13T18:38:37+03:00
projectM: Force building with a specific older C++ version

This fixes errors like these:

libprojectM/projectM.hpp:303:8: error: no template named 'auto_ptr' in namespace 'std'
  std::auto_ptr<Preset> m_activePreset;
  ~~~~~^

The std::auto_ptr type was deprecated in C++11 and removed in C++17.

The VLC C++ headers use C++11 features, so the only working
alternatives here are C++11 or C++14.

(cherry picked from commit 4100c227d052cf5f804acd67904f698e89946110)
Signed-off-by: Martin Storsjö <martin at martin.st>

- - - - -


5 changed files:

- contrib/src/asdcplib/rules.mak
- contrib/src/modplug/rules.mak
- contrib/src/projectM/rules.mak
- modules/demux/mkv/chapters.cpp
- modules/visualization/Makefile.am


Changes:

=====================================
contrib/src/asdcplib/rules.mak
=====================================
@@ -16,6 +16,8 @@ ifeq ($(call need_pkg,"asdcplib >= 1.12"),)
 PKGS_FOUND += asdcplib
 endif
 
+ASDCPLIB_CXXFLAGS := $(CXXFLAGS) -std=gnu++98
+
 $(TARBALLS)/asdcplib-$(ASDCPLIB_VERSION).tar.gz:
 	$(call download_pkg,$(ASDCPLIB_URL),asdcplib)
 
@@ -34,6 +36,6 @@ DEPS_asdcplib = nettle $(DEPS_nettle)
 
 .asdcplib: asdcplib
 	$(RECONF)
-	cd $< && $(HOSTVARS) ./configure $(HOSTCONF) --enable-freedist --enable-dev-headers --with-nettle=$(PREFIX)
+	cd $< && $(HOSTVARS) CXXFLAGS="$(ASDCPLIB_CXXFLAGS)" ./configure $(HOSTCONF) --enable-freedist --enable-dev-headers --with-nettle=$(PREFIX)
 	cd $< && $(MAKE) install
 	touch $@


=====================================
contrib/src/modplug/rules.mak
=====================================
@@ -8,6 +8,8 @@ ifeq ($(call need_pkg,"libmodplug >= 0.8.9.0"),)
 PKGS_FOUND += modplug
 endif
 
+MODPLUG_CXXFLAGS := $(CXXFLAGS) -std=gnu++98
+
 $(TARBALLS)/libmodplug-$(MODPLUG_VERSION).tar.gz:
 	$(call download_pkg,$(MODPLUG_URL),modplug)
 
@@ -26,6 +28,6 @@ endif
 
 .modplug: libmodplug
 	$(RECONF)
-	cd $< && $(HOSTVARS) ./configure $(HOSTCONF)
+	cd $< && $(HOSTVARS) CXXFLAGS="$(MODPLUG_CXXFLAGS)" ./configure $(HOSTCONF)
 	cd $< && $(MAKE) install
 	touch $@


=====================================
contrib/src/projectM/rules.mak
=====================================
@@ -36,6 +36,7 @@ DEPS_projectM = glew $(DEPS_glew)
 .projectM: projectM toolchain.cmake
 	cd $< && rm -f CMakeCache.txt
 	cd $< && $(HOSTVARS) $(CMAKE) \
+		-DCMAKE_CXX_STANDARD=98 \
 		-DINCLUDE-PROJECTM-LIBVISUAL:BOOL=OFF \
 		-DDISABLE_NATIVE_PRESETS:BOOL=ON \
 		-DUSE_FTGL:BOOL=OFF \


=====================================
modules/demux/mkv/chapters.cpp
=====================================
@@ -146,13 +146,14 @@ bool chapter_item_c::EnterLeaveHelper_ ( bool do_subs,
     bool f_result = false;
 
     f_result |= std::count_if ( codecs.begin (), codecs.end (),
-      std::mem_fun (co_cb)
+      std::mem_fn (co_cb)
     );
 
     if ( do_subs )
     {
+        using std::placeholders::_1;
         f_result |= count_if ( sub_chapters.begin (), sub_chapters.end (),
-          std::bind2nd( std::mem_fun( ch_cb ), true )
+          std::bind( std::mem_fn( ch_cb ), _1, true )
         );
     }
 


=====================================
modules/visualization/Makefile.am
=====================================
@@ -19,7 +19,7 @@ EXTRA_LTLIBRARIES += libgoom_plugin.la
 visu_LTLIBRARIES += $(LTLIBgoom)
 
 libprojectm_plugin_la_SOURCES = visualization/projectm.cpp
-libprojectm_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(PROJECTM_CFLAGS)
+libprojectm_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(PROJECTM_CFLAGS) -std=gnu++14
 libprojectm_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(visudir)'
 libprojectm_plugin_la_LIBADD = $(PROJECTM_LIBS) $(LIBPTHREAD)
 EXTRA_LTLIBRARIES += libprojectm_plugin.la



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7c166c1451b50720ac5d2050c0f844034005ba35...01dd8180f048de6c03f26e4290ab7c6b902222f1

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7c166c1451b50720ac5d2050c0f844034005ba35...01dd8180f048de6c03f26e4290ab7c6b902222f1
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list