[vlc-devel] [PATCH 3.0 05/16] contrib: projectM: Don't force building in C++98 mode

Martin Storsjö martin at martin.st
Fri Jun 19 23:26:56 CEST 2020


Instead patch the project to fix the error that was clang gave when
building in C+11 mode (which clang 6 does by default):

Renderer/VideoEcho.cpp:77:30: error: non-constant-expression cannot be narrowed from type 'double' to 'float' in initializer list [-Wc++11-narrowing]
  float pointsFlip[4][2] = {{-0.5*flipx, -0.5*flipy},

(cherry picked from commit e2ea86d8a21d5ddf63f9263aec401f0f8556e671)
---
 contrib/src/projectM/clang6.patch | 18 ++++++++++++++++++
 contrib/src/projectM/rules.mak    |  2 +-
 2 files changed, 19 insertions(+), 1 deletion(-)
 create mode 100644 contrib/src/projectM/clang6.patch

diff --git a/contrib/src/projectM/clang6.patch b/contrib/src/projectM/clang6.patch
new file mode 100644
index 0000000000..122b7fff6c
--- /dev/null
+++ b/contrib/src/projectM/clang6.patch
@@ -0,0 +1,18 @@
+diff -urN projectM-orig/Renderer/VideoEcho.cpp projectM/Renderer/VideoEcho.cpp
+--- projectM-orig/Renderer/VideoEcho.cpp	2009-12-06 03:42:51.000000000 +0200
++++ projectM/Renderer/VideoEcho.cpp	2018-03-29 23:56:45.852289647 +0300
+@@ -74,10 +74,10 @@
+ 			default: flipx=1;flipy=1; break;
+ 		}
+ 
+-		float pointsFlip[4][2] = {{-0.5*flipx, -0.5*flipy},
+-					  {-0.5*flipx,  0.5*flipy},
+-					  { 0.5*flipx,  0.5*flipy},
+-					  { 0.5*flipx, -0.5*flipy}};
++		float pointsFlip[4][2] = {{-0.5f*flipx, -0.5f*flipy},
++					  {-0.5f*flipx,  0.5f*flipy},
++					  { 0.5f*flipx,  0.5f*flipy},
++					  { 0.5f*flipx, -0.5f*flipy}};
+ 
+ 		glVertexPointer(2,GL_FLOAT,0,pointsFlip);
+ 		glDrawArrays(GL_TRIANGLE_FAN,0,4);
diff --git a/contrib/src/projectM/rules.mak b/contrib/src/projectM/rules.mak
index 58b021ae78..0502d0dbce 100644
--- a/contrib/src/projectM/rules.mak
+++ b/contrib/src/projectM/rules.mak
@@ -23,6 +23,7 @@ ifdef HAVE_WIN32
 	$(APPLY) $(SRC)/projectM/win32.patch
 endif
 	$(APPLY) $(SRC)/projectM/gcc6.patch
+	$(APPLY) $(SRC)/projectM/clang6.patch
 	$(MOVE)
 
 DEPS_projectM = glew $(DEPS_glew)
@@ -35,7 +36,6 @@ DEPS_projectM = glew $(DEPS_glew)
 		-DUSE_FTGL:BOOL=OFF \
 		-DINCLUDE-PROJECTM-PULSEAUDIO:BOOL=OFF \
 		-DINCLUDE-PROJECTM-QT:BOOL=OFF \
-		-DCMAKE_CXX_STANDARD=98 \
 		-DBUILD_PROJECTM_STATIC:BOOL=ON .
 	cd $< && $(MAKE) install
 	-cd $<; cp Renderer/libRenderer.a MilkdropPresetFactory/libMilkdropPresetFactory.a $(PREFIX)/lib
-- 
2.17.1



More information about the vlc-devel mailing list