forked from osmocom/wireshark
Fixed "Compiled with" information in the About box.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34601 f5534014-38df-0310-8fa8-9805f1628bb7
This commit is contained in:
parent
e7605da37a
commit
137c3eacfe
|
@ -3613,7 +3613,7 @@ main(int argc, char *argv[])
|
|||
GString *runtime_info_str;
|
||||
/* Assemble the compile-time version information string */
|
||||
comp_info_str = g_string_new("Compiled ");
|
||||
get_compiled_version_info(comp_info_str, NULL);
|
||||
get_compiled_version_info(comp_info_str, NULL, NULL);
|
||||
|
||||
/* Assemble the run-time version information string */
|
||||
runtime_info_str = g_string_new("Running ");
|
||||
|
|
26
gtk/main.c
26
gtk/main.c
|
@ -1853,6 +1853,20 @@ main_capture_callback(gint event, capture_options *capture_opts, gpointer user_d
|
|||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
get_gtk_compiled_info(GString *str)
|
||||
{
|
||||
g_string_append(str, "with ");
|
||||
g_string_append_printf(str,
|
||||
#ifdef GTK_MAJOR_VERSION
|
||||
"GTK+ %d.%d.%d", GTK_MAJOR_VERSION, GTK_MINOR_VERSION,
|
||||
GTK_MICRO_VERSION);
|
||||
#else
|
||||
"GTK+ (version unknown)");
|
||||
#endif
|
||||
g_string_append(str, ", ");
|
||||
}
|
||||
|
||||
static void
|
||||
get_gui_compiled_info(GString *str)
|
||||
{
|
||||
|
@ -2201,17 +2215,7 @@ main(int argc, char *argv[])
|
|||
/* Assemble the compile-time version information string */
|
||||
comp_info_str = g_string_new("Compiled ");
|
||||
|
||||
g_string_append(comp_info_str, "with ");
|
||||
g_string_append_printf(comp_info_str,
|
||||
#ifdef GTK_MAJOR_VERSION
|
||||
"GTK+ %d.%d.%d", GTK_MAJOR_VERSION, GTK_MINOR_VERSION,
|
||||
GTK_MICRO_VERSION);
|
||||
#else
|
||||
"GTK+ (version unknown)");
|
||||
#endif
|
||||
g_string_append(comp_info_str, ", ");
|
||||
|
||||
get_compiled_version_info(comp_info_str, get_gui_compiled_info);
|
||||
get_compiled_version_info(comp_info_str, get_gtk_compiled_info, get_gui_compiled_info);
|
||||
|
||||
/* Assemble the run-time version information string */
|
||||
runtime_info_str = g_string_new("Running ");
|
||||
|
|
|
@ -701,7 +701,7 @@ main(int argc, char *argv[])
|
|||
GString *runtime_info_str;
|
||||
/* Assemble the compile-time version information string */
|
||||
comp_info_str = g_string_new("Compiled ");
|
||||
get_compiled_version_info(comp_info_str, epan_get_compiled_version_info);
|
||||
get_compiled_version_info(comp_info_str, NULL, epan_get_compiled_version_info);
|
||||
|
||||
/* Assemble the run-time version information string */
|
||||
runtime_info_str = g_string_new("Running ");
|
||||
|
|
2
tshark.c
2
tshark.c
|
@ -1257,7 +1257,7 @@ main(int argc, char *argv[])
|
|||
GString *runtime_info_str;
|
||||
/* Assemble the compile-time version information string */
|
||||
comp_info_str = g_string_new("Compiled ");
|
||||
get_compiled_version_info(comp_info_str, epan_get_compiled_version_info);
|
||||
get_compiled_version_info(comp_info_str, NULL, epan_get_compiled_version_info);
|
||||
|
||||
/* Assemble the run-time version information string */
|
||||
runtime_info_str = g_string_new("Running ");
|
||||
|
|
|
@ -117,13 +117,17 @@ end_string(GString *str)
|
|||
* don't use Portaudio in TShark.
|
||||
*/
|
||||
void
|
||||
get_compiled_version_info(GString *str, void (*additional_info)(GString *))
|
||||
get_compiled_version_info(GString *str, void (*prepend_info)(GString *),
|
||||
void (*append_info)(GString *))
|
||||
{
|
||||
if (sizeof(str) == 4)
|
||||
g_string_append(str, "(32-bit) ");
|
||||
else
|
||||
g_string_append(str, "(64-bit) ");
|
||||
|
||||
if (prepend_info)
|
||||
(*prepend_info)(str);
|
||||
|
||||
/* GLIB */
|
||||
g_string_append(str, "with ");
|
||||
g_string_append_printf(str,
|
||||
|
@ -163,8 +167,8 @@ get_compiled_version_info(GString *str, void (*additional_info)(GString *))
|
|||
#endif /* HAVE_LIBCAP */
|
||||
|
||||
/* Additional application-dependent information */
|
||||
if (additional_info)
|
||||
(*additional_info)(str);
|
||||
if (append_info)
|
||||
(*append_info)(str);
|
||||
g_string_append(str, ".");
|
||||
|
||||
#if !defined(HAVE_LIBPCRE) && !GLIB_CHECK_VERSION(2,14,0)
|
||||
|
|
|
@ -39,13 +39,17 @@ extern const gchar *wireshark_svnversion;
|
|||
* Get various library compile-time versions and append them to
|
||||
* the specified GString.
|
||||
*
|
||||
* "additional_info" is called at the end to append any additional
|
||||
* "prepend_info" is called at the start to prepend any additional
|
||||
* information.
|
||||
*
|
||||
* "append_info" is called at the end to append any additional
|
||||
* information; this is required in order to, for example, put the
|
||||
* Portaudio information at the end of the string, as we currently
|
||||
* don't use Portaudio in TShark.
|
||||
*/
|
||||
void get_compiled_version_info(GString *str,
|
||||
void (*additional_info)(GString *));
|
||||
void (*prepend_info)(GString *),
|
||||
void (*append_info)(GString *));
|
||||
|
||||
/*
|
||||
* Get various library run-time versions, and the OS version, and append
|
||||
|
|
Loading…
Reference in New Issue