From 208ec70df83cdbdf2525a46865b6be1ad259d731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20D=C3=ADaz=20M=C3=A1s?= Date: Sun, 27 Feb 2022 12:49:45 +0100 Subject: [PATCH] Fix windows builds --- app/actions.cpp | 3 ++- app/exiv2.cpp | 2 +- src/convert.cpp | 2 +- src/exif.cpp | 2 +- src/xmp.cpp | 4 ++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/actions.cpp b/app/actions.cpp index 114c860c..cf8f44d2 100644 --- a/app/actions.cpp +++ b/app/actions.cpp @@ -59,7 +59,8 @@ #ifdef EXV_HAVE_UNISTD_H # include // for stat() #endif -#ifdef _MSC_VER + +#if defined(_WIN32) || defined(__CYGWIN__) # include #include #include diff --git a/app/exiv2.cpp b/app/exiv2.cpp index 3a93bcb4..3e9518cb 100644 --- a/app/exiv2.cpp +++ b/app/exiv2.cpp @@ -39,7 +39,7 @@ #include #include -#if defined(_MSC_VER) +#if defined(_WIN32) || defined(__CYGWIN__) #include #include #include diff --git a/src/convert.cpp b/src/convert.cpp index 77642c67..af736b96 100644 --- a/src/convert.cpp +++ b/src/convert.cpp @@ -712,7 +712,7 @@ namespace Exiv2 { return; std::ostringstream value; for (size_t i = 0; i < pos->count(); ++i) { - value << static_cast(pos->toInt64(i)); + value << static_cast(pos->toInt64(static_cast(i))); } (*xmpData_)[to] = value.str(); if (erase_) exifData_->erase(pos); diff --git a/src/exif.cpp b/src/exif.cpp index 8df2f6b6..611eb449 100644 --- a/src/exif.cpp +++ b/src/exif.cpp @@ -869,7 +869,7 @@ namespace { { int64_t sum = 0; for (size_t i = 0; i < md.count(); ++i) { - sum += md.toInt64(i); + sum += md.toInt64(static_cast(i)); } return sum; } diff --git a/src/xmp.cpp b/src/xmp.cpp index 630932ce..741b39c7 100644 --- a/src/xmp.cpp +++ b/src/xmp.cpp @@ -953,8 +953,8 @@ namespace Exiv2 { meta.SetProperty(ns.c_str(), i.tagName().c_str(), nullptr, options); for (size_t idx = 0; idx < i.count(); ++idx) { const std::string item = i.tagName() + "[" + toString(idx + 1) + "]"; - printNode(ns, item, i.toString(idx), 0); - meta.SetProperty(ns.c_str(), item.c_str(), i.toString(idx).c_str()); + printNode(ns, item, i.toString(static_cast(idx)), 0); + meta.SetProperty(ns.c_str(), item.c_str(), i.toString(static_cast(idx)).c_str()); } continue; }