Fix exiv2 patch

This commit is contained in:
2024-07-03 01:36:27 +00:00
committed by GitHub
parent ef69e6b826
commit ee79a97a66
2 changed files with 7 additions and 7 deletions

View File

@@ -1,9 +1,9 @@
diff --git a/src/basicio.cpp b/src/basicio.cpp diff --git a/src/basicio.cpp b/src/basicio.cpp
index cd2880651..ab7447071 100644 index 3971cb50c..b76f86e61 100644
--- a/src/basicio.cpp --- a/src/basicio.cpp
+++ b/src/basicio.cpp +++ b/src/basicio.cpp
@@ -62,6 +62,64 @@ void ReplaceStringInPlace(std::string& subject, std::string_view search, std::st @@ -51,6 +51,64 @@ namespace fs = std::experimental::filesystem;
} // namespace #endif
namespace Exiv2 { namespace Exiv2 {
+#if defined(__MINGW__) || (defined(WIN32) && !defined(__CYGWIN__)) +#if defined(__MINGW__) || (defined(WIN32) && !defined(__CYGWIN__))
@@ -67,7 +67,7 @@ index cd2880651..ab7447071 100644
void BasicIo::readOrThrow(byte* buf, size_t rcount, ErrorCode err) { void BasicIo::readOrThrow(byte* buf, size_t rcount, ErrorCode err) {
const size_t nread = read(buf, rcount); const size_t nread = read(buf, rcount);
Internal::enforce(nread == rcount, err); Internal::enforce(nread == rcount, err);
@@ -168,7 +226,11 @@ int FileIo::Impl::switchMode(OpMode opMode) { @@ -158,7 +216,11 @@ int FileIo::Impl::switchMode(OpMode opMode) {
std::fclose(fp_); std::fclose(fp_);
openMode_ = "r+b"; openMode_ = "r+b";
opMode_ = opSeek; opMode_ = opSeek;
@@ -79,7 +79,7 @@ index cd2880651..ab7447071 100644
if (!fp_) if (!fp_)
return 1; return 1;
#ifdef _WIN32 #ifdef _WIN32
@@ -489,7 +551,11 @@ int FileIo::open(const std::string& mode) { @@ -479,7 +541,11 @@ int FileIo::open(const std::string& mode) {
close(); close();
p_->openMode_ = mode; p_->openMode_ = mode;
p_->opMode_ = Impl::opSeek; p_->opMode_ = Impl::opSeek;

View File

@@ -8,9 +8,9 @@ IF NOT EXIST cbuild (
MD cbuild || EXIT /B 1 MD cbuild || EXIT /B 1
) )
CD cbuild || EXIT /B 1 CD cbuild || EXIT /B 1
git clone "https://github.com/Exiv2/exiv2" || EXIT /B %ERRORLEVEL% git clone --depth 1 "https://github.com/Exiv2/exiv2" || EXIT /B %ERRORLEVEL%
CD exiv2 || EXIT /B %ERRORLEVEL% CD exiv2 || EXIT /B %ERRORLEVEL%
git apply -3 %PATCH_DIR%\basicio.cpp.patch || EXIT /B %ERRORLEVEL% git apply %PATCH_DIR%\basicio.cpp.patch || EXIT /B %ERRORLEVEL%
IF NOT EXIST build ( IF NOT EXIST build (
MD build || EXIT /B 1 MD build || EXIT /B 1
) )