aboutsummaryrefslogtreecommitdiffstats
path: root/version_info.c
diff options
context:
space:
mode:
authorStephen Fisher <steve@stephen-fisher.com>2007-11-10 00:57:41 +0000
committerStephen Fisher <steve@stephen-fisher.com>2007-11-10 00:57:41 +0000
commit432aa1788a3521d42bb0f9c50f4373cb1c3cfc58 (patch)
treef0cf26f40205a7ebaf06c324af742d48e1b6c406 /version_info.c
parent6f1740aa6cfd2a73dead385d4f2d526376e7a5c7 (diff)
Add MacOS X version next to the Darwin version in version outputs.
svn path=/trunk/; revision=23418
Diffstat (limited to 'version_info.c')
-rw-r--r--version_info.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/version_info.c b/version_info.c
index cec24ebc85..cd6a65070d 100644
--- a/version_info.c
+++ b/version_info.c
@@ -73,7 +73,11 @@
#ifdef HAVE_LIBSMI
#include <smi.h>
#endif
-
+
+#ifdef HAVE_OS_X_FRAMEWORKS
+#include <CoreServices/CoreServices.h>
+#endif
+
#ifdef SVNVERSION
const char *wireshark_svnversion = " (" SVNVERSION ")";
#else
@@ -256,6 +260,9 @@ get_runtime_version_info(GString *str, void (*additional_info)(GString *))
#elif defined(HAVE_SYS_UTSNAME_H)
struct utsname name;
#endif
+#if HAVE_OS_X_FRAMEWORKS
+ long macosx_ver, macosx_major_ver, macosx_minor_ver, macosx_bugfix_ver;
+#endif
g_string_append(str, "on ");
@@ -408,6 +415,26 @@ get_runtime_version_info(GString *str, void (*additional_info)(GString *))
* thing.
*/
g_string_sprintfa(str, "%s %s", name.sysname, name.release);
+#ifdef HAVE_OS_X_FRAMEWORKS
+ Gestalt(gestaltSystemVersion, &macosx_ver);
+
+ /* The following functions are only available in MacOS 10.4+ */
+ if(macosx_ver >= 0x1040) {
+ Gestalt(gestaltSystemVersionMajor, &macosx_major_ver);
+ Gestalt(gestaltSystemVersionMinor, &macosx_minor_ver);
+ Gestalt(gestaltSystemVersionBugFix, &macosx_bugfix_ver);
+
+ g_string_sprintfa(str, " (MacOS %ld.%ld.%ld)",
+ macosx_major_ver,
+ macosx_minor_ver,
+ macosx_bugfix_ver);
+ } else {
+ g_string_sprintfa(str, " (MacOS X < 10.4 [%lx])",
+ macosx_ver);
+ /* See Apple's Gestalt Manager Reference for meanings
+ * of the macosx_ver values. */
+ }
+#endif /* HAVE_OS_X_FRAMEWORKS */
}
#else
g_string_append(str, "an unknown OS");