| @@ -1,104 +1,104 @@ | | | @@ -1,104 +1,104 @@ |
1 | $NetBSD: patch-OpenEXR.cpp,v 1.2 2021/07/08 21:23:23 markd Exp $ | | 1 | $NetBSD: patch-OpenEXR.cpp,v 1.3 2022/04/29 12:07:43 adam Exp $ |
2 | | | 2 | |
3 | Avoid CS define on SunOS. | | 3 | Avoid CS define on SunOS. |
4 | openexr3 deprecates Int64 | | 4 | openexr3 deprecates Int64 |
5 | | | 5 | |
6 | --- OpenEXR.cpp.orig 2018-08-30 14:53:51.000000000 +0000 | | 6 | --- OpenEXR.cpp.orig 2022-04-17 06:27:41.000000000 +0000 |
7 | +++ OpenEXR.cpp | | 7 | +++ OpenEXR.cpp |
8 | @@ -1,5 +1,9 @@ | | 8 | @@ -1,5 +1,9 @@ |
9 | #include <Python.h> | | 9 | #include <Python.h> |
10 | | | 10 | |
11 | +#ifdef __sun | | 11 | +#ifdef __sun |
12 | +#undef CS | | 12 | +#undef CS |
13 | +#endif | | 13 | +#endif |
14 | + | | 14 | + |
15 | #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) | | 15 | #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) |
16 | typedef int Py_ssize_t; | | 16 | typedef int Py_ssize_t; |
17 | #define PY_SSIZE_T_MAX INT_MAX | | 17 | #define PY_SSIZE_T_MAX INT_MAX |
18 | @@ -44,6 +48,7 @@ typedef int Py_ssize_t; | | 18 | @@ -43,6 +47,7 @@ typedef int Py_ssize_t; |
19 | #include <ImfChannelListAttribute.h> | | 19 | #include <ImfChannelListAttribute.h> |
20 | #include <ImfChromaticitiesAttribute.h> | | 20 | #include <ImfChromaticitiesAttribute.h> |
21 | #include <ImfCompressionAttribute.h> | | 21 | #include <ImfCompressionAttribute.h> |
22 | +#include <ImfFrameBuffer.h> | | 22 | +#include <ImfFrameBuffer.h> |
23 | #include <ImfDoubleAttribute.h> | | 23 | #include <ImfDoubleAttribute.h> |
24 | #include <ImfEnvmapAttribute.h> | | 24 | #include <ImfEnvmapAttribute.h> |
25 | #include <ImfFloatAttribute.h> | | 25 | #include <ImfFloatAttribute.h> |
26 | @@ -72,6 +77,7 @@ typedef int Py_ssize_t; | | 26 | @@ -73,6 +78,7 @@ typedef int Py_ssize_t; |
27 | #include <iostream> | | 27 | #include <iostream> |
28 | #include <iomanip> | | 28 | #include <iomanip> |
29 | #include <iostream> | | 29 | #include <iostream> |
30 | +#include <fstream> | | 30 | +#include <fstream> |
31 | #include <vector> | | 31 | #include <vector> |
32 | | | 32 | |
33 | using namespace std; | | 33 | #define IMATH_VERSION IMATH_VERSION_MAJOR * 10000 + \ |
34 | @@ -105,8 +111,8 @@ class C_IStream: public IStream | | 34 | @@ -115,8 +121,8 @@ class C_IStream: public IStream |
35 | C_IStream (PyObject *fo): | | 35 | C_IStream (PyObject *fo): |
36 | IStream(""), _fo(fo) {} | | 36 | IStream(""), _fo(fo) {} |
37 | virtual bool read (char c[], int n); | | 37 | virtual bool read (char c[], int n); |
38 | - virtual Int64 tellg (); | | 38 | - virtual Int64 tellg (); |
39 | - virtual void seekg (Int64 pos); | | 39 | - virtual void seekg (Int64 pos); |
40 | + virtual uint64_t tellg (); | | 40 | + virtual uint64_t tellg (); |
41 | + virtual void seekg (uint64_t pos); | | 41 | + virtual void seekg (uint64_t pos); |
42 | virtual void clear (); | | 42 | virtual void clear (); |
43 | virtual const char* fileName() const; | | 43 | virtual const char* fileName() const; |
44 | private: | | 44 | private: |
45 | @@ -132,7 +138,7 @@ const char* C_IStream::fileName() const | | 45 | @@ -142,7 +148,7 @@ const char* C_IStream::fileName() const |
46 | } | | 46 | } |
47 | | | 47 | |
48 | | | 48 | |
49 | -Int64 | | 49 | -Int64 |
50 | +uint64_t | | 50 | +uint64_t |
51 | C_IStream::tellg () | | 51 | C_IStream::tellg () |
52 | { | | 52 | { |
53 | PyObject *rv = PyObject_CallMethod(_fo, (char*)"tell", NULL); | | 53 | PyObject *rv = PyObject_CallMethod(_fo, (char*)"tell", NULL); |
54 | @@ -141,14 +147,14 @@ C_IStream::tellg () | | 54 | @@ -151,14 +157,14 @@ C_IStream::tellg () |
55 | long long t = PyLong_AsLong(lrv); | | 55 | long long t = PyLong_AsLong(lrv); |
56 | Py_DECREF(lrv); | | 56 | Py_DECREF(lrv); |
57 | Py_DECREF(rv); | | 57 | Py_DECREF(rv); |
58 | - return (Int64)t; | | 58 | - return (Int64)t; |
59 | + return (uint64_t)t; | | 59 | + return (uint64_t)t; |
60 | } else { | | 60 | } else { |
61 | throw Iex::InputExc("tell failed"); | | 61 | throw Iex::InputExc("tell failed"); |
62 | } | | 62 | } |
63 | } | | 63 | } |
64 | | | 64 | |
65 | void | | 65 | void |
66 | -C_IStream::seekg (Int64 pos) | | 66 | -C_IStream::seekg (Int64 pos) |
67 | +C_IStream::seekg (uint64_t pos) | | 67 | +C_IStream::seekg (uint64_t pos) |
68 | { | | 68 | { |
69 | PyObject *data = PyObject_CallMethod(_fo, (char*)"seek", (char*)"(L)", pos); | | 69 | PyObject *data = PyObject_CallMethod(_fo, (char*)"seek", (char*)"(L)", pos); |
70 | if (data != NULL) { | | 70 | if (data != NULL) { |
71 | @@ -170,8 +176,8 @@ class C_OStream: public OStream | | 71 | @@ -180,8 +186,8 @@ class C_OStream: public OStream |
72 | public: | | 72 | public: |
73 | C_OStream (PyObject *fo): OStream(""), _fo(fo) {} | | 73 | C_OStream (PyObject *fo): OStream(""), _fo(fo) {} |
74 | virtual void write (const char *c, int n); | | 74 | virtual void write (const char *c, int n); |
75 | - virtual Int64 tellp (); | | 75 | - virtual Int64 tellp (); |
76 | - virtual void seekp (Int64 pos); | | 76 | - virtual void seekp (Int64 pos); |
77 | + virtual uint64_t tellp (); | | 77 | + virtual uint64_t tellp (); |
78 | + virtual void seekp (uint64_t pos); | | 78 | + virtual void seekp (uint64_t pos); |
79 | virtual void clear (); | | 79 | virtual void clear (); |
80 | virtual const char* fileName() const; | | 80 | virtual const char* fileName() const; |
81 | private: | | 81 | private: |
82 | @@ -196,7 +202,7 @@ const char* C_OStream::fileName() const | | 82 | @@ -206,7 +212,7 @@ const char* C_OStream::fileName() const |
83 | } | | 83 | } |
84 | | | 84 | |
85 | | | 85 | |
86 | -Int64 | | 86 | -Int64 |
87 | +uint64_t | | 87 | +uint64_t |
88 | C_OStream::tellp () | | 88 | C_OStream::tellp () |
89 | { | | 89 | { |
90 | PyObject *rv = PyObject_CallMethod(_fo, (char*)"tell", NULL); | | 90 | PyObject *rv = PyObject_CallMethod(_fo, (char*)"tell", NULL); |
91 | @@ -205,14 +211,14 @@ C_OStream::tellp () | | 91 | @@ -215,14 +221,14 @@ C_OStream::tellp () |
92 | long long t = PyLong_AsLong(lrv); | | 92 | long long t = PyLong_AsLong(lrv); |
93 | Py_DECREF(lrv); | | 93 | Py_DECREF(lrv); |
94 | Py_DECREF(rv); | | 94 | Py_DECREF(rv); |
95 | - return (Int64)t; | | 95 | - return (Int64)t; |
96 | + return (uint64_t)t; | | 96 | + return (uint64_t)t; |
97 | } else { | | 97 | } else { |
98 | throw Iex::InputExc("tell failed"); | | 98 | throw Iex::InputExc("tell failed"); |
99 | } | | 99 | } |
100 | } | | 100 | } |
101 | | | 101 | |
102 | void | | 102 | void |
103 | -C_OStream::seekp (Int64 pos) | | 103 | -C_OStream::seekp (Int64 pos) |
104 | +C_OStream::seekp (uint64_t pos) | | 104 | +C_OStream::seekp (uint64_t pos) |