diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2010-10-21 07:13:43 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2010-10-21 07:13:43 +0000 |
commit | 2cedc69849087c220c7d9f04c559e9824fde844d (patch) | |
tree | 26815d44b8853ef6cdd90ac777f4b1c569584a76 | |
parent | 5c18160006d1df99214d3a8d0fa30ebfeab7dda7 (diff) |
Fixed "Compiled with" information in the About box.
svn path=/trunk/; revision=34601
-rw-r--r-- | dumpcap.c | 2 | ||||
-rw-r--r-- | gtk/main.c | 26 | ||||
-rw-r--r-- | rawshark.c | 2 | ||||
-rw-r--r-- | tshark.c | 2 | ||||
-rw-r--r-- | version_info.c | 10 | ||||
-rw-r--r-- | version_info.h | 8 |
6 files changed, 31 insertions, 19 deletions
@@ -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 "); diff --git a/gtk/main.c b/gtk/main.c index 99d242dd24..8a30db6321 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1854,6 +1854,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) { epan_get_compiled_version_info(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 "); diff --git a/rawshark.c b/rawshark.c index a5fd3b9c27..a02ae0cbf8 100644 --- a/rawshark.c +++ b/rawshark.c @@ -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 "); @@ -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 "); diff --git a/version_info.c b/version_info.c index ce99b5ce75..32f99fca4e 100644 --- a/version_info.c +++ b/version_info.c @@ -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) diff --git a/version_info.h b/version_info.h index 71638f98d1..0d85d17a5b 100644 --- a/version_info.h +++ b/version_info.h @@ -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 |