From: Po Lu Date: Sat, 20 Jul 2024 04:39:33 +0000 (+0800) Subject: Fix compilation on builds with native rectangle structures X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ebc1974fe806e8cd30dd409754e9928300b2df51;p=emacs.git 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) --- 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 */