summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTing-Wei Lan <lantw@src.gnome.org>2018-11-18 14:09:08 +0800
committerEmmanuele Bassi <ebassi@gnome.org>2019-03-07 15:10:45 +0000
commit2e432c9db52e8b078270086517ab7d6f15ebec81 (patch)
tree875aaa5373cb669b6cc281eba930807937c09b84
parent214c7ff8ba5fb30c70a0759c9d77f767e4f32a0d (diff)
downloadgnome-color-manager-2e432c9db52e8b078270086517ab7d6f15ebec81.tar.gz
Fix build with Exiv2 0.27
The first parameter of Exiv2::Error has changed from an int to an Exiv2::ErrorCode enum.
-rw-r--r--src/gcm-helper-exiv.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gcm-helper-exiv.cpp b/src/gcm-helper-exiv.cpp
index 9854e79..ffbc82c 100644
--- a/src/gcm-helper-exiv.cpp
+++ b/src/gcm-helper-exiv.cpp
@@ -24,6 +24,10 @@
#include <iostream>
#include <iomanip>
+#if EXIV2_MAJOR_VERSION >= 1 || (EXIV2_MAJOR_VERSION == 0 && EXIV2_MINOR_VERSION >= 27)
+#define HAVE_EXIV2_ERROR_CODE
+#endif
+
int
main (int argc, char* const argv[])
{
@@ -51,7 +55,11 @@ main (int argc, char* const argv[])
if (argc == 2)
filename = argv[1];
if (filename.empty())
+#ifdef HAVE_EXIV2_ERROR_CODE
+ throw Exiv2::Error(Exiv2::kerErrorMessage, "No filename specified");
+#else
throw Exiv2::Error(1, "No filename specified");
+#endif
image = Exiv2::ImageFactory::open(filename);
image->readMetadata();
@@ -60,7 +68,11 @@ main (int argc, char* const argv[])
if (exifData.empty()) {
std::string error(argv[1]);
error += ": No Exif data found in the file";
+#ifdef HAVE_EXIV2_ERROR_CODE
+ throw Exiv2::Error(Exiv2::kerErrorMessage, error);
+#else
throw Exiv2::Error(1, error);
+#endif
}
/* try to find make, model and serial number */