You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2015/01/14 04:26:51 UTC

svn commit: r1651565 - /subversion/trunk/subversion/include/svn_version.h

Author: brane
Date: Wed Jan 14 03:26:51 2015
New Revision: 1651565

URL: http://svn.apache.org/r1651565
Log:
Embed a version string into our libraries.
This can help administrators double-check the library versions
by using the ancient, standar Unix 'what' utility, or equivalent
string search. It can also help binary distros to identify any
weird custom patches by tweaking the SVN_VER_TAG constant.

* subversion/include/svn_version.h
  (SVN_VERSION_BODY): Change the implementation so that the
   value of SVN_VERSION gets embedded into static data.

Modified:
    subversion/trunk/subversion/include/svn_version.h

Modified: subversion/trunk/subversion/include/svn_version.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_version.h?rev=1651565&r1=1651564&r2=1651565&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_version.h (original)
+++ subversion/trunk/subversion/include/svn_version.h Wed Jan 14 03:26:51 2015
@@ -175,10 +175,25 @@ struct svn_version_t
  * Generate the implementation of a version query function.
  *
  * @since New in 1.1.
+ * @since Since 1.9, embeds a string into the compiled object
+ *        file that can be queried with the 'what' utility.
  */
-#define SVN_VERSION_BODY \
-  SVN_VERSION_DEFINE(versioninfo);              \
-  return &versioninfo
+#define SVN_VERSION_BODY            \
+  static struct versioninfo_t       \
+    {                               \
+      const char *const str;        \
+      const svn_version_t num;      \
+    } const versioninfo =           \
+    {                               \
+      "@(#)" SVN_VERSION,           \
+      {                             \
+        SVN_VER_MAJOR,              \
+        SVN_VER_MINOR,              \
+        SVN_VER_PATCH,              \
+        SVN_VER_NUMTAG              \
+      }                             \
+    };                              \
+  return &versioninfo.num
 
 /**
  * Check library version compatibility. Return #TRUE if the client's