[vlc-commits] [Git][videolan/vlc][master] 4 commits: contrib: projectM: Force building with a specific older C++ version

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Sep 13 13:26:57 UTC 2022



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
3e29d7f6 by Martin Storsjö at 2022-09-13T11:58:30+00: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.)

- - - - -
fb8eb5ed by Martin Storsjö at 2022-09-13T11:58:30+00: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;
  ^~~~~~~~~

- - - - -
72e7335d by Martin Storsjö at 2022-09-13T11:58:30+00: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;\
        ^

- - - - -
4100c227 by Martin Storsjö at 2022-09-13T11:58:30+00: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.

- - - - -


4 changed files:

- contrib/src/asdcplib/rules.mak
- contrib/src/modplug/rules.mak
- contrib/src/projectM/rules.mak
- 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 @@ endif
 	$(MOVE)
 
 PROJECTM_CONF := \
+		-DCMAKE_CXX_STANDARD=98 \
 		-DDISABLE_NATIVE_PRESETS:BOOL=ON \
 		-DUSE_FTGL:BOOL=OFF \
 		-DBUILD_PROJECTM_STATIC:BOOL=ON


=====================================
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)
 EXTRA_LTLIBRARIES += libprojectm_plugin.la



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ba9b27e1aedcb35300bb919392ad4dd086c2c286...4100c227d052cf5f804acd67904f698e89946110

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ba9b27e1aedcb35300bb919392ad4dd086c2c286...4100c227d052cf5f804acd67904f698e89946110
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