>From 1936a82c889ee6c11c7b19f126afd06e6c950565 Mon Sep 17 00:00:00 2001 From: Alan Third Date: Tue, 30 May 2017 19:48:17 +0100 Subject: [PATCH] Fix build errors on macOS 10.6 * src/nsfns.m (compute_tip_xy): Don't use CGRectContainsPoint. --- src/nsfns.m | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/nsfns.m b/src/nsfns.m index 7bac2836fe..0c865070fb 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -2752,16 +2752,19 @@ and GNUstep implementations ("distributor-specific release /* Find the screen that pt is on. */ for (screen in [NSScreen screens]) -#ifdef NS_IMPL_COCOA - if (CGRectContainsPoint ((CGRect)[screen frame], (CGPoint)pt)) -#else if (pt.x >= screen.frame.origin.x && pt.x < screen.frame.origin.x + screen.frame.size.width && pt.y >= screen.frame.origin.y && pt.y < screen.frame.origin.y + screen.frame.size.height) -#endif break; + /* We could use this instead of the if above: + + if (CGRectContainsPoint ([screen frame], pt)) + + which would be neater, but it causes problems building on old + versions of macOS and in GNUstep. */ + /* Ensure in bounds. (Note, screen origin = lower left.) */ if (INTEGERP (left) || INTEGERP (right)) *root_x = pt.x; -- 2.12.0