diff src/macfns.c @ 90667:dbe3f29e61d6

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 505-522) - Update from CVS - Merge from gnus--rel--5.10 - Update from CVS: etc/TUTORIAL.cn: Updated. - Merge from erc--emacs--22 * gnus--rel--5.10 (patch 164-167) - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-137
author Miles Bader <miles@gnu.org>
date Tue, 21 Nov 2006 08:56:38 +0000
parents 02cf29720f31 6b0e5b6fca4f
children 6588c6259dfb
line wrap: on
line diff
--- a/src/macfns.c	Tue Nov 21 01:10:47 2006 +0000
+++ b/src/macfns.c	Tue Nov 21 08:56:38 2006 +0000
@@ -3092,18 +3092,30 @@
      Lisp_Object display;
 {
   struct mac_display_info *dpyinfo = check_x_display_info (display);
+
   /* Only of the main display.  */
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
-  CGSize size;
-
-  BLOCK_INPUT;
-  size = CGDisplayScreenSize (kCGDirectMainDisplay);
-  UNBLOCK_INPUT;
-
-  return make_number ((int) (size.height + .5f));
-#else
-  /* This is an approximation.  */
-  return make_number ((int) (dpyinfo->height * 25.4 / dpyinfo->resy));
+#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+  if (CGDisplayScreenSize != NULL)
+#endif
+    {
+      CGSize size;
+
+      BLOCK_INPUT;
+      size = CGDisplayScreenSize (kCGDirectMainDisplay);
+      UNBLOCK_INPUT;
+
+      return make_number ((int) (size.height + .5f));
+    }
+#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+  else
+#endif
+#endif	/* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030  */
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 || MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+    {
+      /* This is an approximation.  */
+      return make_number ((int) (dpyinfo->height * 25.4 / dpyinfo->resy));
+    }
 #endif
 }
 
@@ -3116,18 +3128,30 @@
      Lisp_Object display;
 {
   struct mac_display_info *dpyinfo = check_x_display_info (display);
+
   /* Only of the main display.  */
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
-  CGSize size;
-
-  BLOCK_INPUT;
-  size = CGDisplayScreenSize (kCGDirectMainDisplay);
-  UNBLOCK_INPUT;
-
-  return make_number ((int) (size.width + .5f));
-#else
-  /* This is an approximation.  */
-  return make_number ((int) (dpyinfo->width * 25.4 / dpyinfo->resx));
+#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+  if (CGDisplayScreenSize != NULL)
+#endif
+    {
+      CGSize size;
+
+      BLOCK_INPUT;
+      size = CGDisplayScreenSize (kCGDirectMainDisplay);
+      UNBLOCK_INPUT;
+
+      return make_number ((int) (size.width + .5f));
+    }
+#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+  else
+#endif
+#endif	/* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030  */
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 || MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+    {
+      /* This is an approximation.  */
+      return make_number ((int) (dpyinfo->width * 25.4 / dpyinfo->resx));
+    }
 #endif
 }