[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:38:20 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=d67d00f

The following commit has been merged in the master branch:
commit d67d00ffd461b3b2fb7195b2021015798762f60f
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Tue Mar 6 15:33:12 2007 +0000

    Fixed version check macro to actually check the runtime version and not the compile-time version. Added version() and versionNumber() functions.
---
 src/Makefile                               |  5 +--
 src/{mn.hpp => exiv2_version.cpp}          | 48 +++++++++++++++------------
 src/{exiv2_version.h => exiv2_version.hpp} | 52 +++++++++++++++++++-----------
 src/types.hpp                              |  2 +-
 4 files changed, 66 insertions(+), 41 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index c2b384e..a13263c 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -47,7 +47,7 @@ include $(top_srcdir)/config/config.mk
 # Source files
 
 # Add standalone C++ header files to this list
-CCHDR =  exiv2_version.h      \
+CCHDR =  exiv2_version.hpp    \
          exv_conf.h           \
          exv_msvc.h           \
          mn.hpp               \
@@ -62,6 +62,7 @@ CCSRC =  basicio.cpp          \
 	 datasets.cpp         \
 	 error.cpp            \
 	 exif.cpp             \
+	 exiv2_version.cpp    \
 	 futils.cpp           \
 	 fujimn.cpp           \
 	 ifd.cpp              \
@@ -93,7 +94,7 @@ CCSRC += rafimage.cpp         \
 
 # Add library C source files to this list
 ifndef HAVE_TIMEGM
-CSRC = localtime.c
+CSRC =   localtime.c
 endif
 
 # Add source files of simple applications to this list
diff --git a/src/mn.hpp b/src/exiv2_version.cpp
similarity index 57%
copy from src/mn.hpp
copy to src/exiv2_version.cpp
index dad0369..816b4e1 100644
--- a/src/mn.hpp
+++ b/src/exiv2_version.cpp
@@ -1,6 +1,6 @@
 // ***************************************************************** -*- C++ -*-
 /*
- * Copyright (C) 2004-2007 Andreas Huggel <ahuggel at gmx.net>
+ * Copyright (C) 2007 Andreas Huggel <ahuggel at gmx.net>
  *
  * This program is part of the Exiv2 distribution.
  *
@@ -18,27 +18,35 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
  */
-/*!
-  @file    mn.hpp
-  @brief   Include all makernote header files. Makes sure that the static
-           variable used to register makernotes is instantiated.
-  @version $Rev$
-  @author  Andreas Huggel (ahu)
-           <a href="mailto:ahuggel at gmx.net">ahuggel at gmx.net</a>
-  @date    28-May-05, ahu: created
+/*
+  File:      exiv2_version.cpp
+  Version:   $Rev$
+  Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
+  History:   06-Mar-07, ahu: created
+
  */
-#ifndef MN_HPP_
-#define MN_HPP_
+// *****************************************************************************
+#include "rcsid.hpp"
+EXIV2_RCSID("@(#) $Id$")
 
 // *****************************************************************************
 // included header files
-#include "canonmn.hpp"
-#include "fujimn.hpp"
-#include "minoltamn.hpp"
-#include "nikonmn.hpp"
-#include "olympusmn.hpp"
-#include "panasonicmn.hpp"
-#include "sigmamn.hpp"
-#include "sonymn.hpp"
+#ifdef _MSC_VER
+# include "exv_msvc.h"
+#else
+# include "exv_conf.h"
+#endif
+
+#include "exiv2_version.hpp"
+
+namespace Exiv2 {
+    int versionNumber()
+    {
+        return EXIV2_MAKE_VERSION(EXIV2_MAJOR_VERSION, EXIV2_MINOR_VERSION, EXIV2_PATCH_VERSION);
+    }
 
-#endif                                  // #ifndef MN_HPP_
+    const char* version()
+    {
+        return EXV_PACKAGE_VERSION;
+    }
+}                                       // namespace Exiv2
diff --git a/src/exiv2_version.h b/src/exiv2_version.hpp
similarity index 61%
rename from src/exiv2_version.h
rename to src/exiv2_version.hpp
index 62970c9..61d41d9 100644
--- a/src/exiv2_version.h
+++ b/src/exiv2_version.hpp
@@ -19,9 +19,8 @@
  * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
  */
 /*!
-  @file    exiv2_version.h
-  @brief   Define to check the %Exiv2 version. The %Exiv2 library itself does not
-           use the defines in this file, they are meant for use by applications.
+  @file    exiv2_version.hpp
+  @brief   Define to check the %Exiv2 version. 
            References: Similar versioning defines are used in KDE, GTK and other
            libraries. See http://apr.apache.org/versioning.html for accompanying
            guidelines.
@@ -30,19 +29,19 @@
            <a href="mailto:ahuggel at gmx.net">ahuggel at gmx.net</a>
   @date    31-May-06, ahu: created
  */
-#ifndef EXIV2_VERSION_H_
-#define EXIV2_VERSION_H_
+#ifndef EXIV2_VERSION_HPP_
+#define EXIV2_VERSION_HPP_
 
 /*!
-  @brief %Exiv2 MAJOR version number.
+  @brief %Exiv2 MAJOR version number of the library used at compile-time.
  */
 #define EXIV2_MAJOR_VERSION  (0)
 /*!
-  @brief %Exiv2 MINOR version number.
+  @brief %Exiv2 MINOR version number of the library used at compile-time.
  */
 #define EXIV2_MINOR_VERSION (13)
 /*!
-  @brief %Exiv2 PATCH version number.
+  @brief %Exiv2 PATCH version number of the library used at compile-time.
  */
 #define EXIV2_PATCH_VERSION  (0)
 /*!
@@ -52,13 +51,14 @@
 #define EXIV2_MAKE_VERSION(major,minor,patch) \
     (((major) << 16) | ((minor) << 8) | (patch))
 /*!
-  @brief The %Exiv2 version number as an integer number for easy comparison.
+  @brief The %Exiv2 version number of the library used at compile-time as 
+         an integer number for easy comparison.
  */
 #define EXIV2_VERSION \
     EXIV2_MAKE_VERSION(EXIV2_MAJOR_VERSION,EXIV2_MINOR_VERSION,EXIV2_PATCH_VERSION)
 /*!
-  @brief Check the version of the %Exiv2 library. Return TRUE if the version of
-         %Exiv2 is the same as or newer than the passed-in version.
+  @brief Check 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 standard triplet of integers:
   MAJOR.MINOR.PATCH. The basic intent is that MAJOR versions are incompatible,
@@ -74,8 +74,8 @@
   regard to the restrictions detailed in the above document.
 
   @code
-  // Don't include the exiv2_version.h file, it is included by types.hpp
-  // Exiv2 versions before 0.10 didn't have this file and the macros
+  // Don't include the exiv2_version.hpp file, it is included by types.hpp
+  // Early Exiv2 versions didn't have this file and the macros
 
   #ifndef EXIV2_CHECK_VERSION
   # define EXIV2_CHECK_VERSION(a,b,c) (false)
@@ -83,16 +83,32 @@
 
   // ...
 
+  std::cout << "Compiled with Exiv2 version " << EXV_PACKAGE_VERSION << "
"
+            << "Runtime Exiv2 version is    " << Exiv2::version() << "
";
+
   // Check the Exiv2 version available at runtime
-  if (EXIV2_CHECK_VERSION(0,10,0)) {
-      // Available Exiv2 version is equal to or greater than requested
+  if (EXIV2_CHECK_VERSION(0,13,0)) {
+      std::cout << "Available Exiv2 version is equal to or greater than 0.13
";
   }
   else {
-      // Installed Exiv2 version is less than requested
+      std::cout << "Installed Exiv2 version is less than 0.13
";
   }
+  return 0;
   @endcode
  */
 #define EXIV2_CHECK_VERSION(major,minor,patch) \
-    ( EXIV2_VERSION >= EXIV2_MAKE_VERSION(major,minor,patch) )
+    ( Exiv2::versionNumber() >= EXIV2_MAKE_VERSION(major,minor,patch) )
 
-#endif /* EXIV2_VERSION_H_ */
+// *****************************************************************************
+// namespace extensions
+namespace Exiv2 {
+    /*!
+      @brief Return the version of %Exiv2 available at runtime as an integer.
+    */
+    int versionNumber();
+    /*!
+      @brief Return the version of %Exiv2 available at runtime as a string.
+    */
+    const char* version();
+}                                       // namespace Exiv2
+#endif                                  // EXIV2_VERSION_HPP_
diff --git a/src/types.hpp b/src/types.hpp
index f4b4575..c37fa16 100644
--- a/src/types.hpp
+++ b/src/types.hpp
@@ -39,7 +39,7 @@
 # include "exv_conf.h"
 #endif
 
-#include "exiv2_version.h"
+#include "exiv2_version.hpp"
 
 // + standard includes
 #include <string>

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list