diff --git a/src/convert.cpp b/src/convert.cpp index 217632ee..f0c33804 100644 --- a/src/convert.cpp +++ b/src/convert.cpp @@ -826,12 +826,16 @@ namespace Exiv2 { try { SXMPUtils::ConvertToDate(value, &datetime); } - catch (const XMP_Error& e) { #ifndef SUPPRESS_WARNINGS + catch (const XMP_Error& e) { std::cerr << "Warning: Failed to convert " << from << " to " << to << " (" << e.GetErrMsg() << ")\n"; -#endif return; } +#else + catch (const XMP_Error&) { + return; + } +#endif // SUPPRESS_WARNINGS char buf[30]; if (std::string(to) != "Exif.GPSInfo.GPSTimeStamp") { diff --git a/src/xmp.cpp b/src/xmp.cpp index 4594f7c1..936c9895 100644 --- a/src/xmp.cpp +++ b/src/xmp.cpp @@ -566,13 +566,19 @@ namespace Exiv2 { return 0; } - catch (const XMP_Error& e) { #ifndef SUPPRESS_WARNINGS + catch (const XMP_Error& e) { std::cerr << Error(40, e.GetID(), e.GetErrMsg()) << "\n"; -#endif xmpData.clear(); return 3; - }} // XmpParser::decode + } +#else + catch (const XMP_Error&) { + xmpData.clear(); + return 3; + } +#endif // SUPPRESS_WARNINGS + } // XmpParser::decode #else int XmpParser::decode( XmpData& xmpData, const std::string& xmpPacket) @@ -681,12 +687,17 @@ namespace Exiv2 { return 0; } - catch (const XMP_Error& e) { #ifndef SUPPRESS_WARNINGS + catch (const XMP_Error& e) { std::cerr << Error(40, e.GetID(), e.GetErrMsg()) << "\n"; -#endif return 3; - }} // XmpParser::decode + } +#else + catch (const XMP_Error& e) { + return 3; + } +#endif // SUPPRESS_WARNINGS + } // XmpParser::decode #else int XmpParser::encode( std::string& /*xmpPacket*/, const XmpData& xmpData,