From 9346531434a0091a5655d83f9436fa011431bcfd Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Thu, 19 Oct 2006 08:01:25 +0000 Subject: [PATCH] (Vmac_carbon_version_string) [TARGET_API_MAC_CARBON]: New variable. (syms_of_macfns) [TARGET_API_MAC_CARBON]: Defvar it. --- src/macfns.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/macfns.c b/src/macfns.c index 49c72e1bf4f..1b3a7223b63 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -51,6 +51,14 @@ Boston, MA 02110-1301, USA. */ 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 @@ such a font. This is especially effective for such large fonts as 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); -- 2.39.2