e58b03d
diff -rupN --no-dereference freeimage-svn-r1909-FreeImage-trunk/Source/FreeImage/PluginEXR.cpp freeimage-svn-r1909-FreeImage-trunk-new/Source/FreeImage/PluginEXR.cpp
e58b03d
--- freeimage-svn-r1909-FreeImage-trunk/Source/FreeImage/PluginEXR.cpp	2023-09-28 20:09:13.031484703 +0200
e58b03d
+++ freeimage-svn-r1909-FreeImage-trunk-new/Source/FreeImage/PluginEXR.cpp	2023-09-28 20:09:13.148487858 +0200
3763124
@@ -37,8 +37,22 @@
3763124
 #include <OpenEXR/ImfRgba.h>
3763124
 #include <OpenEXR/ImfArray.h>
3763124
 #include <OpenEXR/ImfPreviewImage.h>
3763124
-#include <OpenEXR/half.h>
3763124
-
3763124
+// The version can reliably be found in this header file from OpenEXR,
3763124
+// for both 2.x and 3.x:
3763124
+#include <OpenEXR/OpenEXRConfig.h>
3763124
+#define COMBINED_OPENEXR_VERSION ((10000*OPENEXR_VERSION_MAJOR) + \
3763124
+                                  (100*OPENEXR_VERSION_MINOR) + \
3763124
+                                  OPENEXR_VERSION_PATCH)
3763124
+
3763124
+// There's just no easy way to have an `#include` that works in both
3763124
+// cases, so we use the version to switch which set of include files we
3763124
+// use.
3763124
+#if COMBINED_OPENEXR_VERSION >= 20599 /* 2.5.99: pre-3.0 */
3763124
+#   include <Imath/half.h>
3763124
+#else
3763124
+    // OpenEXR 2.x, use the old locations
3763124
+#   include <OpenEXR/half.h>
3763124
+#endif
3763124
 
3763124
 // ==========================================================
3763124
 // Plugin Interface
3763124
@@ -66,11 +80,11 @@ public:
3763124
 		return ((unsigned)n != _io->read_proc(c, 1, n, _handle));
3763124
 	}
3763124
 
3763124
-	virtual Imath::Int64 tellg() {
3763124
+	virtual uint64_t tellg() {
3763124
 		return _io->tell_proc(_handle);
3763124
 	}
3763124
 
3763124
-	virtual void seekg(Imath::Int64 pos) {
3763124
+	virtual void seekg(uint64_t pos) {
3763124
 		_io->seek_proc(_handle, (unsigned)pos, SEEK_SET);
3763124
 	}
3763124
 
3763124
@@ -100,11 +114,11 @@ public:
3763124
 		}
3763124
 	}
3763124
 
3763124
-	virtual Imath::Int64 tellp() {
3763124
+	virtual uint64_t tellp() {
3763124
 		return _io->tell_proc(_handle);
3763124
 	}
3763124
 
3763124
-	virtual void seekp(Imath::Int64 pos) {
3763124
+	virtual void seekp(uint64_t pos) {
3763124
 		_io->seek_proc(_handle, (unsigned)pos, SEEK_SET);
3763124
 	}
3763124
 };
e58b03d
diff -rupN --no-dereference freeimage-svn-r1909-FreeImage-trunk/Source/FreeImage/PluginTIFF.cpp freeimage-svn-r1909-FreeImage-trunk-new/Source/FreeImage/PluginTIFF.cpp
e58b03d
--- freeimage-svn-r1909-FreeImage-trunk/Source/FreeImage/PluginTIFF.cpp	2023-09-28 20:09:13.034484784 +0200
e58b03d
+++ freeimage-svn-r1909-FreeImage-trunk-new/Source/FreeImage/PluginTIFF.cpp	2023-09-28 20:09:13.149487885 +0200
3763124
@@ -39,7 +39,24 @@
3763124
 #include "Utilities.h"
3763124
 #include <tiffio.h>
3763124
 #include "../Metadata/FreeImageTag.h"
3763124
-#include <OpenEXR/half.h>
3763124
+// The version can reliably be found in this header file from OpenEXR,
3763124
+// for both 2.x and 3.x:
3763124
+#include <OpenEXR/OpenEXRConfig.h>
3763124
+#define COMBINED_OPENEXR_VERSION ((10000*OPENEXR_VERSION_MAJOR) + \
3763124
+                                  (100*OPENEXR_VERSION_MINOR) + \
3763124
+                                  OPENEXR_VERSION_PATCH)
3763124
+
3763124
+// There's just no easy way to have an `#include` that works in both
3763124
+// cases, so we use the version to switch which set of include files we
3763124
+// use.
3763124
+#if COMBINED_OPENEXR_VERSION >= 20599 /* 2.5.99: pre-3.0 */
3763124
+#   include <Imath/ImathVec.h>
3763124
+#   include <Imath/half.h>
3763124
+#else
3763124
+    // OpenEXR 2.x, use the old locations
3763124
+#   include <OpenEXR/ImathVec.h>
3763124
+#   include <OpenEXR/half.h>
3763124
+#endif
3763124
 
3763124
 #include "FreeImageIO.h"
3763124
 #include "PSDParser.h"