# HG changeset patch # User YAMAMOTO Mitsuharu # Date 1161244885 0 # Node ID e243e9e31c7a5b06d9e537e8e87325d953a156c0 # Parent c24e4c92d898db8a27c88d43b1685306eaf17ed2 (Vmac_carbon_version_string) [TARGET_API_MAC_CARBON]: New variable. (syms_of_macfns) [TARGET_API_MAC_CARBON]: Defvar it. diff -r c24e4c92d898 -r e243e9e31c7a src/macfns.c --- 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);