From ab6aac054ade7c01a9cff5a9dbaa095b2e40be5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20D=C3=ADaz=20M=C3=A1s?= Date: Thu, 13 Sep 2018 16:22:48 +0200 Subject: [PATCH] Remove deprecated code from version source files --- include/exiv2/version.hpp | 99 --------------------------------------- src/epsimage.cpp | 1 + src/version.cpp | 11 ----- 3 files changed, 1 insertion(+), 110 deletions(-) diff --git a/include/exiv2/version.hpp b/include/exiv2/version.hpp index dd40f0dd..bf9b1e35 100644 --- a/include/exiv2/version.hpp +++ b/include/exiv2/version.hpp @@ -78,58 +78,6 @@ */ #define EXIV2_VERSION \ EXIV2_MAKE_VERSION(EXIV2_MAJOR_VERSION,EXIV2_MINOR_VERSION,EXIV2_PATCH_VERSION) -/*! - @brief Deprecated version check macro. Do not use. - - This macro has flaws and only remains for backward compatibility. - Use EXIV2_TEST_VERSION and testVersion() instead. - */ -#define EXIV2_CHECK_VERSION(major,minor,patch) \ - ( Exiv2::versionNumber() >= EXIV2_MAKE_VERSION(major,minor,patch) ) -/*! - @brief Macro to test the version of the available %Exiv2 library at compile-time. - Return true if it is the same as or newer than the passed-in version. - - Versions are denoted using a triplet of integers: \em MAJOR.MINOR.PATCH . - - @code - // Don't include the file directly, it is included by - // . Early Exiv2 versions didn't have version.hpp and the macros. - - #include - - // Make sure an EXIV2_TEST_VERSION macro exists: - - #ifdef EXIV2_VERSION - # ifndef EXIV2_TEST_VERSION - # define EXIV2_TEST_VERSION(major,minor,patch) \ - ( EXIV2_VERSION >= EXIV2_MAKE_VERSION(major,minor,patch) ) - # endif - #else - # define EXIV2_TEST_VERSION(major,minor,patch) (false) - #endif - - std::cout << "Compiled with Exiv2 version " << EXV_PACKAGE_VERSION << "\n" - << "Runtime Exiv2 version is " << Exiv2::version() << "\n"; - - // Test the Exiv2 version available at runtime but compile the if-clause only if - // the compile-time version is at least 0.15. Earlier versions didn't have a - // testVersion() function: - - #if EXIV2_TEST_VERSION(0,15,0) - if (Exiv2::testVersion(0,13,0)) { - std::cout << "Available Exiv2 version is equal to or greater than 0.13\n"; - } - else { - std::cout << "Installed Exiv2 version is less than 0.13\n"; - } - #else - std::cout << "Compile-time Exiv2 version doesn't have Exiv2::testVersion()\n"; - #endif - @endcode - */ -#define EXIV2_TEST_VERSION(major,minor,patch) \ - ( EXIV2_VERSION >= EXIV2_MAKE_VERSION(major,minor,patch) ) // ***************************************************************************** // namespace extensions @@ -146,53 +94,6 @@ namespace Exiv2 { @brief Return the version of %Exiv2 as hex string of fixed length 6. */ EXIV2API std::string versionNumberHexString(); - /*! - @brief Return the version of %Exiv2 available at runtime as a string. - */ - EXIV2API const char* version(); - /*! - @brief Test the version of the available %Exiv2 library at runtime. Return - true if it is the same as or newer than the passed-in version. - - Versions are denoted using a triplet of integers: \em major.minor.patch . - - @code - // Don't include the file directly, it is included by - // . Early Exiv2 versions didn't have version.hpp and the macros. - - #include - - // Make sure an EXIV2_TEST_VERSION macro exists: - - #ifdef EXIV2_VERSION - # ifndef EXIV2_TEST_VERSION - # define EXIV2_TEST_VERSION(major,minor,patch) \ - ( EXIV2_VERSION >= EXIV2_MAKE_VERSION(major,minor,patch) ) - # endif - #else - # define EXIV2_TEST_VERSION(major,minor,patch) (false) - #endif - - std::cout << "Compiled with Exiv2 version " << EXV_PACKAGE_VERSION << "\n" - << "Runtime Exiv2 version is " << Exiv2::version() << "\n"; - - // Test the Exiv2 version available at runtime but compile the if-clause only if - // the compile-time version is at least 0.15. Earlier versions didn't have a - // testVersion() function: - - #if EXIV2_TEST_VERSION(0,15,0) - if (Exiv2::testVersion(0,13,0)) { - std::cout << "Available Exiv2 version is equal to or greater than 0.13\n"; - } - else { - std::cout << "Installed Exiv2 version is less than 0.13\n"; - } - #else - std::cout << "Compile-time Exiv2 version doesn't have Exiv2::testVersion()\n"; - #endif - @endcode - */ - EXIV2API bool testVersion(int major, int minor, int patch); /*! @brief dumpLibraryInfo implements the exiv2 option --version --verbose diff --git a/src/epsimage.cpp b/src/epsimage.cpp index 8566aa07..2d91cee7 100644 --- a/src/epsimage.cpp +++ b/src/epsimage.cpp @@ -32,6 +32,7 @@ #include "basicio.hpp" #include "error.hpp" #include "futils.hpp" +#include "version.hpp" // + standard includes #include diff --git a/src/version.cpp b/src/version.cpp index cdd0b228..10e1b454 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -52,7 +52,6 @@ #include #include #include -#include #include #include @@ -82,16 +81,6 @@ namespace Exiv2 { os << std::hex << std::setw(6) << std::setfill('0') << Exiv2::versionNumber(); return os.str(); } - - const char* version() - { - return EXV_PACKAGE_VERSION; - } - - bool testVersion(int major, int minor, int patch) - { - return versionNumber() >= EXIV2_MAKE_VERSION(major,minor,patch); - } } // namespace Exiv2 #ifndef lengthof