From ebc1974fe806e8cd30dd409754e9928300b2df51 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sat, 20 Jul 2024 12:39:33 +0800 Subject: [PATCH] Fix compilation on builds with native rectangle structures * src/androidgui.h (CONVERT_TO_NATIVE_RECT) (CONVERT_FROM_EMACS_RECT): Delete redundant macro definitions. * src/xdisp.c (Fremember_mouse_glyph) [CONVERT_TO_EMACS_RECT]: Expand CONVERT_TO_EMACS_RECT to convert native rectangles into a readable format if required. Reported by Stefan Kangas . (cherry picked from commit 358dbbb723b735eddd3f821ffeaf5382778433bd) --- src/androidgui.h | 2 -- src/xdisp.c | 14 +++++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/androidgui.h b/src/androidgui.h index 79e42c7947c..2bd9d3741da 100644 --- a/src/androidgui.h +++ b/src/androidgui.h @@ -216,8 +216,6 @@ struct android_swap_info }; #define NativeRectangle Emacs_Rectangle -#define CONVERT_TO_NATIVE_RECT(xr, nr) ((xr) = (nr)) -#define CONVERT_FROM_EMACS_RECT(xr, nr) ((nr) = (xr)) #define STORE_NATIVE_RECT(nr, rx, ry, rwidth, rheight) \ ((nr).x = (rx), (nr).y = (ry), \ diff --git a/src/xdisp.c b/src/xdisp.c index 74ccfd9e745..4185e368c96 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -3017,12 +3017,20 @@ point of FRAME. */) (Lisp_Object frame, Lisp_Object x, Lisp_Object y) { struct frame *f = decode_window_system_frame (frame); - NativeRectangle r; + NativeRectangle rect; +#ifdef CONVERT_TO_EMACS_RECT + Emacs_Rectangle xrect; +#endif /* CONVERT_TO_EMACS_RECT */ CHECK_FIXNUM (x); CHECK_FIXNUM (y); - remember_mouse_glyph (f, XFIXNUM (x), XFIXNUM (y), &r); - return list4i (r.x, r.y, r.width, r.height); + remember_mouse_glyph (f, XFIXNUM (x), XFIXNUM (y), &rect); +#ifdef CONVERT_TO_EMACS_RECT + CONVERT_TO_EMACS_RECT (xrect, rect); + return list4i (xrect.x, xrect.y, xrect.width, xrect.height); +#else /* !defined CONVERT_TO_EMACS_RECT */ + return list4i (rect.x, rect.y, rect.width, rect.height); +#endif /* !defined CONVERT_TO_EMACS_RECT */ } #endif /* HAVE_WINDOW_SYSTEM */ -- 2.39.2