Add openexr_viewers-gcc-11-fixes.patch

This commit is contained in:
Nicolas Chauvet 2022-01-03 16:13:34 +01:00
parent 83a2cd75d4
commit eb693360ac

View File

@ -0,0 +1,67 @@
diff -ur openexr_viewers-2.3.0/exrdisplay/ImageView.cpp openexr_viewers-2.3.0.orig/exrdisplay/ImageView.cpp
--- openexr_viewers-2.3.0/exrdisplay/ImageView.cpp 2022-01-03 16:09:36.458801342 +0100
+++ openexr_viewers-2.3.0.orig/exrdisplay/ImageView.cpp 2022-01-03 16:06:43.121271236 +0100
@@ -50,6 +50,7 @@
#include <algorithm>
#include <stdio.h>
+#include <limits>
#if defined PLATFORM_WINDOWS || defined _WIN32
#include <windows.h>
@@ -170,8 +171,8 @@
//
// find zmax and zmin values of deep data to set bound
//
- float zmax = limits<float>::min();
- float zmin = limits<float>::max();
+ float zmax = std::numeric_limits<float>::min();
+ float zmin = std::numeric_limits<float>::max();
_maxCount = 0;
for (int k = 0; k < _zsize; k++)
diff -ur openexr_viewers-2.3.0/exrdisplay/main.cpp openexr_viewers-2.3.0.orig/exrdisplay/main.cpp
--- openexr_viewers-2.3.0/exrdisplay/main.cpp 2022-01-03 16:09:36.460801325 +0100
+++ openexr_viewers-2.3.0.orig/exrdisplay/main.cpp 2022-01-03 16:05:04.747106129 +0100
@@ -69,6 +69,7 @@
#include <algorithm>
#include <string>
#include <exception>
+#include <limits>
#include <string.h>
#include <stdlib.h>
@@ -781,7 +782,7 @@
int lx = -1;
int ly = -1;
- float farPlane = limits<float>::max(); //default value of zfar plane
+ float farPlane = numeric_limits<float>::max(); //default value of zfar plane
bool deepComp = true; // attempt to composite deep images together
//
diff -ur openexr_viewers-2.3.0/exrdisplay/scaleImage.cpp openexr_viewers-2.3.0.orig/exrdisplay/scaleImage.cpp
--- openexr_viewers-2.3.0/exrdisplay/scaleImage.cpp 2022-01-03 16:09:36.458801342 +0100
+++ openexr_viewers-2.3.0.orig/exrdisplay/scaleImage.cpp 2022-01-03 16:09:04.024076387 +0100
@@ -195,8 +195,8 @@
void
normalizePixels (int dw, int dh, Array<Rgba> &pixels)
{
- float pMax = -IMATH::limits<float>::max ();
- float pMin = IMATH::limits<float>::max ();
+ float pMax = std::numeric_limits<float>::max ();
+ float pMin = std::numeric_limits<float>::min ();
for (int i = 0; i < dw * dh; ++i)
{
diff -ur openexr_viewers-2.3.0/playexr/FileReadingThread.cpp openexr_viewers-2.3.0.orig/playexr/FileReadingThread.cpp
--- openexr_viewers-2.3.0/playexr/FileReadingThread.cpp 2022-01-03 16:09:36.454801376 +0100
+++ openexr_viewers-2.3.0.orig/playexr/FileReadingThread.cpp 2022-01-03 16:01:09.931103948 +0100
@@ -41,6 +41,7 @@
#include "FileReadingThread.h"
#include "fileNameForFrame.h"
#include "ImageBuffers.h"
+#include <ImfHeader.h>
#include <ImfInputFile.h>
#include <Iex.h>
#include <iostream>