Fix 2.2.0 breaking c++ code build with -std=c++03 (#2053052, #2053073)

This commit is contained in:
Hans de Goede 2022-02-22 23:34:29 +01:00
parent 11f2b7852e
commit 82508f8a43
2 changed files with 19 additions and 2 deletions

View File

@ -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 <cstdint> with __cplusplus < 201103L */
+# if defined(__cplusplus) && __cplusplus >= 201103L
# include <cstddef>
# include <cstdint>
# else

View File

@ -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 <hdegoede@redhat.com> - 2.2.0-2
- Fix 2.2.0 breaking c++ code build with -std=c++03 (#2053052, #2053073)
* Wed Feb 09 2022 Orion Poplawski <orion@nwra.com> - 2.2.0-1
- Update to 2.2.0 (bz#2049077)