Add version info for lz4, zstd, maxmind

This simply implements the patches given in a comment on bug 16270.
<https://gitlab.com/wireshark/wireshark/-/issues/16270#note_400748726>
This commit is contained in:
David Perry 2021-05-17 08:18:10 -04:00 committed by Wireshark GitLab Utility
parent a1a2b53663
commit a1ba9453ef
2 changed files with 33 additions and 2 deletions

View File

@ -362,9 +362,12 @@ target_include_directories(epan
${GTHREAD2_INCLUDE_DIRS}
${LIBXML2_INCLUDE_DIRS}
${LUA_INCLUDE_DIRS}
${LZ4_INCLUDE_DIRS}
${MAXMINDDB_INCLUDE_DIRS}
${NGHTTP2_INCLUDE_DIRS}
${SMI_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
${ZSTD_INCLUDE_DIRS}
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}

View File

@ -74,6 +74,18 @@
#include <ares_version.h>
#ifdef HAVE_LZ4
#include <lz4.h>
#endif
#ifdef HAVE_ZSTD
#include <zstd.h>
#endif
#ifdef HAVE_MAXMINDDB
#include <maxminddb.h>
#endif
#ifdef HAVE_NGHTTP2
#include <nghttp2/nghttp2ver.h>
#endif
@ -794,7 +806,12 @@ epan_get_compiled_version_info(GString *str)
/* MaxMindDB */
g_string_append(str, ", ");
#ifdef HAVE_MAXMINDDB
# ifdef PACKAGE_VERSION
/* maxmind only defines PACKAGE_VERSION if _WIN32 */
g_string_append(str, "with MaxMind DB resolver " PACKAGE_VERSION);
# else
g_string_append(str, "with MaxMind DB resolver");
# endif /* PACKAGE_VERSION */
#else
g_string_append(str, "without MaxMind DB resolver");
#endif /* HAVE_MAXMINDDB */
@ -818,7 +835,7 @@ epan_get_compiled_version_info(GString *str)
/* LZ4 */
g_string_append(str, ", ");
#ifdef HAVE_LZ4
g_string_append(str, "with LZ4");
g_string_append(str, "with LZ4 " LZ4_VERSION_STRING);
#else
g_string_append(str, "without LZ4");
#endif /* HAVE_LZ4 */
@ -826,7 +843,7 @@ epan_get_compiled_version_info(GString *str)
/* Zstandard */
g_string_append(str, ", ");
#ifdef HAVE_ZSTD
g_string_append(str, "with Zstandard");
g_string_append(str, "with Zstandard " ZSTD_VERSION_STRING);
#else
g_string_append(str, "without Zstandard");
#endif /* HAVE_ZSTD */
@ -868,6 +885,17 @@ epan_get_runtime_version_info(GString *str)
g_string_append_printf(str, ", with brotli %d.%d.%d", BrotliDecoderVersion() >> 24,
(BrotliDecoderVersion() >> 12) & 0xFFF, BrotliDecoderVersion() & 0xFFF);
#endif
/* LZ4 */
#ifdef HAVE_LZ4
g_string_append_printf(str, ", with LZ4 %s", LZ4_versionString());
#endif /* HAVE_LZ4 */
/* Zstandard */
#ifdef HAVE_ZSTD
g_string_append_printf(str, ", with Zstandard %s", ZSTD_versionString());
#endif /* HAVE_ZSTD */
}
/*