changeset 73430:e243e9e31c7a

(Vmac_carbon_version_string) [TARGET_API_MAC_CARBON]: New variable. (syms_of_macfns) [TARGET_API_MAC_CARBON]: Defvar it.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Thu, 19 Oct 2006 08:01:25 +0000
parents c24e4c92d898
children 246a1d48fea4
files src/macfns.c
diffstat 1 files changed, 24 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/macfns.c	Thu Oct 19 08:00:30 2006 +0000
+++ b/src/macfns.c	Thu Oct 19 08:01:25 2006 +0000
@@ -51,6 +51,14 @@
 
 extern void free_frame_menubar ();
 
+#if TARGET_API_MAC_CARBON
+
+/* Carbon version info */
+
+static Lisp_Object Vmac_carbon_version_string;
+
+#endif	/* TARGET_API_MAC_CARBON */
+
 /* Non-zero means we're allowed to display an hourglass cursor.  */
 
 int display_hourglass_p;
@@ -4718,6 +4726,22 @@
 Chinese, Japanese, and Korean.  */);
   Vx_pixel_size_width_font_regexp = Qnil;
 
+#if TARGET_API_MAC_CARBON
+  DEFVAR_LISP ("mac-carbon-version-string", &Vmac_carbon_version_string,
+    doc: /* Version info for Carbon API.  */);
+  {
+    OSErr err;
+    UInt32 response;
+    char carbon_version[16] = "Unknown";
+
+    err = Gestalt (gestaltCarbonVersion, &response);
+    if (err == noErr)
+      sprintf (carbon_version, "%u.%u.%u",
+	       (response >> 8) & 0xf, (response >> 4) & 0xf, response & 0xf);
+    Vmac_carbon_version_string = build_string (carbon_version);
+  }
+#endif	/* TARGET_API_MAC_CARBON */
+
   /* X window properties.  */
   defsubr (&Sx_change_window_property);
   defsubr (&Sx_delete_window_property);