From 82508f8a434f3124b1116128f2df4f9ff2b5b671 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 22 Feb 2022 23:34:29 +0100 Subject: [PATCH] Fix 2.2.0 breaking c++ code build with -std=c++03 (#2053052, #2053073) --- glew-2.2.0-gcc12-cplusplus.patch | 13 +++++++++++++ glew.spec | 8 ++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 glew-2.2.0-gcc12-cplusplus.patch diff --git a/glew-2.2.0-gcc12-cplusplus.patch b/glew-2.2.0-gcc12-cplusplus.patch new file mode 100644 index 0000000..3d4a61a --- /dev/null +++ b/glew-2.2.0-gcc12-cplusplus.patch @@ -0,0 +1,13 @@ +diff -up glew-2.2.0/include/GL/glew.h~ glew-2.2.0/include/GL/glew.h +--- glew-2.2.0/include/GL/glew.h~ 2020-03-15 12:53:59.000000000 +0100 ++++ glew-2.2.0/include/GL/glew.h 2022-02-22 23:17:58.889834158 +0100 +@@ -220,7 +220,8 @@ typedef _W64 int ptrdiff_t; + */ + + #if defined(__APPLE__) || defined(__linux__) +-# if defined(__cplusplus) ++/* GCC12 errors out when including with __cplusplus < 201103L */ ++# if defined(__cplusplus) && __cplusplus >= 201103L + # include + # include + # else diff --git a/glew.spec b/glew.spec index 9f06323..bda5806 100644 --- a/glew.spec +++ b/glew.spec @@ -1,15 +1,16 @@ Name: glew Version: 2.2.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The OpenGL Extension Wrangler Library License: BSD and MIT URL: https://github.com/nigels-com/glew Source0: https://github.com/nigels-com/glew/releases/download/glew-%{version}/glew-%{version}.tgz Patch0: glew-2.1.0-install.patch +Patch1: glew-2.2.0-gcc12-cplusplus.patch BuildRequires: gcc BuildRequires: libGLU-devel -BuildRequires: make +BuildRequires: make %description The OpenGL Extension Wrangler Library (GLEW) is a cross-platform C/C++ @@ -76,6 +77,9 @@ chmod 0755 $RPM_BUILD_ROOT%{_libdir}/*.so* %doc doc/* %changelog +* Tue Feb 22 2022 Hans de Goede - 2.2.0-2 +- Fix 2.2.0 breaking c++ code build with -std=c++03 (#2053052, #2053073) + * Wed Feb 09 2022 Orion Poplawski - 2.2.0-1 - Update to 2.2.0 (bz#2049077)