From 8ac49969c20dea4df771d67d9cec1eb35e2f6eb5 Mon Sep 17 00:00:00 2001 From: luofeng14 Date: Mon, 21 Aug 2023 08:47:10 +0000 Subject: [PATCH] Support build with clang Signed-off-by: luofeng14 --- fix-clang-build-error.patch | 18 ++++++++++++++++++ ftgl.spec | 10 ++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 fix-clang-build-error.patch diff --git a/fix-clang-build-error.patch b/fix-clang-build-error.patch new file mode 100644 index 0000000..89cf36d --- /dev/null +++ b/fix-clang-build-error.patch @@ -0,0 +1,18 @@ +diff --git a/simple.cpp b/simple.cpp +index 1e93ccb..5ec083b 100644 +--- a/demo/simple.cpp ++++ b/demo/simple.cpp +@@ -105,9 +105,10 @@ static void RenderScene(void) + float t2 = sin(n / 50 + 1); + float t3 = sin(n / 30 + 2); + +- float ambient[4] = { (t1 + 2.0) / 3, +- (t2 + 2.0) / 3, +- (t3 + 2.0) / 3, 0.3 }; ++ float ambient[4] = {static_cast((t1 + 2.0) / 3), ++ static_cast((t2 + 2.0) / 3), ++ static_cast((t3 + 2.0) / 3, 0.3) }; ++ + float diffuse[4] = { 1.0, 0.9, 0.9, 1.0 }; + float specular[4] = { 1.0, 0.7, 0.7, 1.0 }; + float position[4] = { 100.0, 100.0, 0.0, 1.0 }; diff --git a/ftgl.spec b/ftgl.spec index fc8b941..67218eb 100644 --- a/ftgl.spec +++ b/ftgl.spec @@ -1,6 +1,6 @@ Name: ftgl Version: 2.1.3 -Release: 0.21.rc1%{?dist} +Release: 0.21.rc2%{?dist} Summary: OpenGL frontend to Freetype 2 License: LGPLv2 @@ -8,6 +8,7 @@ URL: http://ftgl.wiki.sourceforge.net/ Source0: http://downloads.sourceforge.net/ftgl/ftgl-%{version}-rc5.tar.bz2 Patch0: ftgl-2.1.3-rc5-ttf_font.patch Patch1: ftgl-2.1.3-rc5-ldflags.patch +Patch2: fix-clang-build-error.patch BuildRequires: gcc-c++ BuildRequires: doxygen @@ -49,9 +50,7 @@ This package contains documentation files for %{name}. %prep -%setup -q -n ftgl-%{version}~rc5 -%patch0 -p1 -b .destdir -%patch1 -p1 -b .ldflags +%autosetup -p1 -n ftgl-%{version}~rc5 @@ -100,5 +99,8 @@ rm -rf $RPM_BUILD_ROOT%{_datadir}/doc %ChangeLog +* Wed Apr 26 2023 Xiaoya Huang - 2.1.3-0.21.rc2 +- Fix clang build error + * Sat May 16 2020 Hubble Zhu - 2.1.3-0.21.rc1 - Init package -- Gitee