freeimage: Fix building with latest libraw.

This commit is contained in:
nia 2021-10-06 14:48:29 +00:00
parent 34a029bc70
commit 732fe0fe2a
2 changed files with 54 additions and 5 deletions

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.12 2021/07/11 04:08:06 markd Exp $
$NetBSD: distinfo,v 1.13 2021/10/06 14:48:29 nia Exp $
SHA1 (FreeImage3180.zip) = 38daa9d8f1bca2330a2eaa42ec66fbe6ede7dce9
RMD160 (FreeImage3180.zip) = b791715fccf49355a3cb27b6250d8ed809c2454e
@ -16,7 +16,7 @@ SHA1 (patch-Source_FreeImage_PluginJ2K.cpp) = bbc44884aba8be3af2aa824da5cf788d91
SHA1 (patch-Source_FreeImage_PluginJP2.cpp) = 9a6d27e039b2050004a2d331389bdfa32dffe681
SHA1 (patch-Source_FreeImage_PluginJPEG.cpp) = 9ed3ce6d70871c9657a69daa4f68ae8423e100a2
SHA1 (patch-Source_FreeImage_PluginPNG.cpp) = 0d9c71856a9355f56c3e9a571a414098d8af2e88
SHA1 (patch-Source_FreeImage_PluginRAW.cpp) = 1d67ad2b634e2a5b1fa82be240a4d6edfad7c05d
SHA1 (patch-Source_FreeImage_PluginRAW.cpp) = 0aad009320f3da38272e17f65576400d97c4d4f5
SHA1 (patch-Source_FreeImage_PluginTIFF.cpp) = bfa869452929f62162c15982b58013b0d43e9f8e
SHA1 (patch-Source_FreeImage_PluginWebP.cpp) = d7b57cfcb1379c6a849edb219c8a59edae83ff5c
SHA1 (patch-Source_FreeImage_ZLibInterface.cpp) = 73211e8ecefb7972f1fcb579dc4a17409c81c480

View file

@ -1,8 +1,9 @@
$NetBSD: patch-Source_FreeImage_PluginRAW.cpp,v 1.1 2020/05/14 16:42:14 nia Exp $
$NetBSD: patch-Source_FreeImage_PluginRAW.cpp,v 1.2 2021/10/06 14:48:29 nia Exp $
Unbundle image libraries.
- Unbundle image libraries.
- Fix building with libraw-0.20.
--- Source/FreeImage/PluginRAW.cpp.orig 2015-03-10 11:12:04.000000000 +0000
--- Source/FreeImage/PluginRAW.cpp.orig 2015-03-10 10:12:04.000000000 +0000
+++ Source/FreeImage/PluginRAW.cpp
@@ -19,7 +19,7 @@
// Use at your own risk!
@ -13,3 +14,51 @@ Unbundle image libraries.
#include "FreeImage.h"
#include "Utilities.h"
@@ -63,17 +63,14 @@ public:
}
int read(void *buffer, size_t size, size_t count) {
- if(substream) return substream->read(buffer, size, count);
return _io->read_proc(buffer, (unsigned)size, (unsigned)count, _handle);
}
int seek(INT64 offset, int origin) {
- if(substream) return substream->seek(offset, origin);
return _io->seek_proc(_handle, (long)offset, origin);
}
INT64 tell() {
- if(substream) return substream->tell();
return _io->tell_proc(_handle);
}
@@ -83,13 +80,11 @@ public:
int get_char() {
int c = 0;
- if(substream) return substream->get_char();
if(!_io->read_proc(&c, 1, 1, _handle)) return -1;
return c;
}
char* gets(char *buffer, int length) {
- if (substream) return substream->gets(buffer, length);
memset(buffer, 0, length);
for(int i = 0; i < length; i++) {
if(!_io->read_proc(&buffer[i], 1, 1, _handle))
@@ -104,7 +99,6 @@ public:
std::string buffer;
char element = 0;
bool bDone = false;
- if(substream) return substream->scanf_one(fmt,val);
do {
if(_io->read_proc(&element, 1, 1, _handle) == 1) {
switch(element) {
@@ -127,7 +121,6 @@ public:
}
int eof() {
- if(substream) return substream->eof();
return (_io->tell_proc(_handle) >= _eof);
}