summarylogtreecommitdiffstats
path: root/fix_isnan_isinf.patch
blob: c6ec99db72d3ee4f0337fe149943cded1a2741ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
From d7c2e0522d8b7de457e63c69ba239d11893603df Mon Sep 17 00:00:00 2001
From: howetuft <howetuft@gmail.com>
Date: Sun, 28 Feb 2021 11:41:33 +0100
Subject: [PATCH 1/3] Include OIIO headers before project headers

Otherwise, in OIIO latest version, it introduces a conflict related to
project's macro 'isinf(f)' (defined in include/luxrays/utils/utils.h)
---
 src/slg/imagemap/imagemap.cpp                         | 7 ++++---
 src/slg/lights/visibility/envlightvisibilitycache.cpp | 6 +++---
 src/slg/slg.cpp                                       | 4 ++--
 src/slg/textures/texture.cpp                          | 4 ++--
 4 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/slg/imagemap/imagemap.cpp b/src/slg/imagemap/imagemap.cpp
index 3acd8739a..009d992bb 100644
--- a/src/slg/imagemap/imagemap.cpp
+++ b/src/slg/imagemap/imagemap.cpp
@@ -1,4 +1,5 @@
 /***************************************************************************
+ *
  * Copyright 1998-2020 by authors (see AUTHORS.txt)                        *
  *                                                                         *
  *   This file is part of LuxCoreRender.                                   *
@@ -24,13 +25,13 @@
 #include <boost/foreach.hpp>
 #include <boost/filesystem.hpp>
 
-#include "luxrays/utils/properties.h"
-#include "slg/core/sdl.h"
-
 #include <OpenImageIO/imagebufalgo.h>
 #include <OpenImageIO/imagebuf.h>
 #include <OpenImageIO/dassert.h>
 
+#include "luxrays/utils/properties.h"
+#include "slg/core/sdl.h"
+
 #include "slg/imagemap/imagemap.h"
 #include "slg/imagemap/imagemapcache.h"
 #include "slg/utils/filenameresolver.h"
diff --git a/src/slg/lights/visibility/envlightvisibilitycache.cpp b/src/slg/lights/visibility/envlightvisibilitycache.cpp
index 8cb1fc0bd..0af405b78 100644
--- a/src/slg/lights/visibility/envlightvisibilitycache.cpp
+++ b/src/slg/lights/visibility/envlightvisibilitycache.cpp
@@ -25,13 +25,13 @@
 #include <boost/thread.hpp>
 #include <boost/chrono.hpp>
 
+#include <OpenImageIO/imageio.h>
+#include <OpenImageIO/imagebuf.h>
+
 #include "luxrays/core/bvh/bvhbuild.h"
 #include "luxrays/utils/atomic.h"
 #include "luxrays/utils/safesave.h"
 
-#include <OpenImageIO/imageio.h>
-#include <OpenImageIO/imagebuf.h>
-
 #include "slg/samplers/metropolis.h"
 #include "slg/lights/visibility/envlightvisibilitycache.h"
 #include "slg/film/imagepipeline/plugins/gaussianblur3x3.h"
diff --git a/src/slg/slg.cpp b/src/slg/slg.cpp
index 6c886107c..3e1b122da 100644
--- a/src/slg/slg.cpp
+++ b/src/slg/slg.cpp
@@ -18,12 +18,12 @@
 
 #include <openvdb/openvdb.h>
 
+#include <OpenImageIO/imageio.h>
+
 #include "luxrays/luxrays.h"
 #include "slg/slg.h"
 #include "slg/utils/filenameresolver.h"
 
-#include <OpenImageIO/imageio.h>
-
 using namespace std;
 using namespace luxrays;
 using namespace slg;
diff --git a/src/slg/textures/texture.cpp b/src/slg/textures/texture.cpp
index a66d25ba4..7498296ac 100644
--- a/src/slg/textures/texture.cpp
+++ b/src/slg/textures/texture.cpp
@@ -23,12 +23,12 @@
 #include <boost/foreach.hpp>
 #include <boost/filesystem.hpp>
 
-#include "slg/core/sdl.h"
-
 #include <OpenImageIO/imagebufalgo.h>
 #include <OpenImageIO/imagebuf.h>
 #include <OpenImageIO/dassert.h>
 
+#include "slg/core/sdl.h"
+
 #include "slg/bsdf/bsdf.h"
 #include "slg/textures/texture.h"
 #include "slg/textures/blender_texture.h"

From 56ce80a04babf440e05c673dd529ec30d949b1f4 Mon Sep 17 00:00:00 2001
From: howetuft <howetuft@gmail.com>
Date: Sun, 28 Feb 2021 15:31:40 +0100
Subject: [PATCH 2/3] Revert "Include OIIO headers before project headers"

This reverts commit ce9b6827d5c26b03cd776d4c37182267804a098e.
---
 src/slg/imagemap/imagemap.cpp                         | 7 +++----
 src/slg/lights/visibility/envlightvisibilitycache.cpp | 6 +++---
 src/slg/slg.cpp                                       | 4 ++--
 src/slg/textures/texture.cpp                          | 4 ++--
 4 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/src/slg/imagemap/imagemap.cpp b/src/slg/imagemap/imagemap.cpp
index 009d992bb..3acd8739a 100644
--- a/src/slg/imagemap/imagemap.cpp
+++ b/src/slg/imagemap/imagemap.cpp
@@ -1,5 +1,4 @@
 /***************************************************************************
- *
  * Copyright 1998-2020 by authors (see AUTHORS.txt)                        *
  *                                                                         *
  *   This file is part of LuxCoreRender.                                   *
@@ -25,13 +24,13 @@
 #include <boost/foreach.hpp>
 #include <boost/filesystem.hpp>
 
+#include "luxrays/utils/properties.h"
+#include "slg/core/sdl.h"
+
 #include <OpenImageIO/imagebufalgo.h>
 #include <OpenImageIO/imagebuf.h>
 #include <OpenImageIO/dassert.h>
 
-#include "luxrays/utils/properties.h"
-#include "slg/core/sdl.h"
-
 #include "slg/imagemap/imagemap.h"
 #include "slg/imagemap/imagemapcache.h"
 #include "slg/utils/filenameresolver.h"
diff --git a/src/slg/lights/visibility/envlightvisibilitycache.cpp b/src/slg/lights/visibility/envlightvisibilitycache.cpp
index 0af405b78..8cb1fc0bd 100644
--- a/src/slg/lights/visibility/envlightvisibilitycache.cpp
+++ b/src/slg/lights/visibility/envlightvisibilitycache.cpp
@@ -25,13 +25,13 @@
 #include <boost/thread.hpp>
 #include <boost/chrono.hpp>
 
-#include <OpenImageIO/imageio.h>
-#include <OpenImageIO/imagebuf.h>
-
 #include "luxrays/core/bvh/bvhbuild.h"
 #include "luxrays/utils/atomic.h"
 #include "luxrays/utils/safesave.h"
 
+#include <OpenImageIO/imageio.h>
+#include <OpenImageIO/imagebuf.h>
+
 #include "slg/samplers/metropolis.h"
 #include "slg/lights/visibility/envlightvisibilitycache.h"
 #include "slg/film/imagepipeline/plugins/gaussianblur3x3.h"
diff --git a/src/slg/slg.cpp b/src/slg/slg.cpp
index 3e1b122da..6c886107c 100644
--- a/src/slg/slg.cpp
+++ b/src/slg/slg.cpp
@@ -18,12 +18,12 @@
 
 #include <openvdb/openvdb.h>
 
-#include <OpenImageIO/imageio.h>
-
 #include "luxrays/luxrays.h"
 #include "slg/slg.h"
 #include "slg/utils/filenameresolver.h"
 
+#include <OpenImageIO/imageio.h>
+
 using namespace std;
 using namespace luxrays;
 using namespace slg;
diff --git a/src/slg/textures/texture.cpp b/src/slg/textures/texture.cpp
index 7498296ac..a66d25ba4 100644
--- a/src/slg/textures/texture.cpp
+++ b/src/slg/textures/texture.cpp
@@ -23,12 +23,12 @@
 #include <boost/foreach.hpp>
 #include <boost/filesystem.hpp>
 
+#include "slg/core/sdl.h"
+
 #include <OpenImageIO/imagebufalgo.h>
 #include <OpenImageIO/imagebuf.h>
 #include <OpenImageIO/dassert.h>
 
-#include "slg/core/sdl.h"
-
 #include "slg/bsdf/bsdf.h"
 #include "slg/textures/texture.h"
 #include "slg/textures/blender_texture.h"

From de6eea0f5e792d2034d479a2403aa1136d09180f Mon Sep 17 00:00:00 2001
From: howetuft <howetuft@gmail.com>
Date: Sun, 28 Feb 2021 15:50:45 +0100
Subject: [PATCH 3/3] Declare isnan and isinf by 'using' statement rather than
 macro

---
 include/luxrays/utils/utils.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/luxrays/utils/utils.h b/include/luxrays/utils/utils.h
index 1a49d5465..af52bbdc5 100644
--- a/include/luxrays/utils/utils.h
+++ b/include/luxrays/utils/utils.h
@@ -36,8 +36,8 @@
 #define isnan(a) _isnan(a)
 #define isinf(f) (!_finite((f)))
 #else
-#define isnan(a) std::isnan(a)
-#define isinf(f) std::isinf(f)
+using std::isnan;
+using std::isinf;
 #endif
 
 #if defined(WIN32)