On 11 August 2017 at 23:28, Ivan Zhakov <i...@visualsvn.com> wrote:
> Log message:
> [[[
> Add LZ4 library verison info to svn --version -v.
>
> * subversion/libsvn_subr/sysinfo.c
>   (): Include lz4/lz4internal.h or lz4.h depending on SVN_INTERNAL_LZ4.
>   (svn_sysinfo__linked_libs): Add LZ4 library version info.
> ]]]
>
V2 version of the patch:
- display 'static' for statically linked LZ4
- do not use LZ4_VERSION_STRING and LZ4_versionString() API, because
they are not available in older version of LZ4 library.



-- 
Ivan Zhakov
Index: subversion/libsvn_subr/sysinfo.c
===================================================================
--- subversion/libsvn_subr/sysinfo.c    (revision 1804819)
+++ subversion/libsvn_subr/sysinfo.c    (working copy)
@@ -51,6 +51,12 @@
 #include "sysinfo.h"
 #include "svn_private_config.h"
 
+#if SVN_INTERNAL_LZ4
+#include "lz4/lz4internal.h"
+#else
+#include <lz4.h>
+#endif
+
 #if HAVE_SYS_UTSNAME_H
 #include <sys/utsname.h>
 #endif
@@ -167,6 +173,20 @@
   lib->compiled_version = apr_pstrdup(pool, svn_zlib__compiled_version());
   lib->runtime_version = apr_pstrdup(pool, svn_zlib__runtime_version());
 
+  lib = &APR_ARRAY_PUSH(array, svn_version_ext_linked_lib_t);
+  lib->name = "LZ4";
+  lib->compiled_version = apr_psprintf(pool, "%d.%d.%d", LZ4_VERSION_MAJOR,
+                                       LZ4_VERSION_MINOR,
+                                       LZ4_VERSION_RELEASE);
+#ifdef SVN_INTERNAL_LZ4
+  lib->runtime_version = NULL;
+#else
+  lib->runtime_version = apr_psprintf(pool, "%d.%d.%d",
+                                      LZ4_versionNumber() / (100*100),
+                                      (LZ4_versionNumber() / 100) % 100,
+                                      LZ4_versionNumber() % 100);
+#endif
+
   return array;
 }
 

Reply via email to