From: Po Lu Date: Tue, 25 Jan 2022 03:49:39 +0000 (+0800) Subject: Improve portability of X11 IM code X-Git-Tag: emacs-29.0.90~2768 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ec403abc6078e2236762d85fe206703602014377;p=emacs.git Improve portability of X11 IM code * configure.ac: Test for XICCallback.callback if X11R6 or later. * src/xfns.c (Xxic_preedit_start_callback): Use XICCallback if present. --- diff --git a/configure.ac b/configure.ac index e5574b6b054..ae92b85be13 100644 --- a/configure.ac +++ b/configure.ac @@ -2639,6 +2639,7 @@ fail; AC_DEFINE(HAVE_X11R6, 1, [Define to 1 if you have the X11R6 or newer version of Xlib.]) AC_DEFINE(HAVE_X_I18N, 1, [Define if you have usable i18n support.]) + AC_CHECK_MEMBERS([XICCallback.callback], [], [], [#include ]) ## inoue@ainet.or.jp says Solaris has a bug related to X11R6-style ## XIM support. case "$opsys" in diff --git a/src/xfns.c b/src/xfns.c index bb1e431ff87..faab1b11582 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -2342,14 +2342,19 @@ static void xic_preedit_caret_callback (XIC, XPointer, XIMPreeditCaretCallbackSt static void xic_preedit_done_callback (XIC, XPointer, XPointer); static int xic_preedit_start_callback (XIC, XPointer, XPointer); +#ifndef HAVE_XICCALLBACK_CALLBACK +#define XICCallback XIMCallback +#define XICProc XIMProc +#endif + static XIMCallback Xxic_preedit_draw_callback = { NULL, (XIMProc) xic_preedit_draw_callback }; static XIMCallback Xxic_preedit_caret_callback = { NULL, (XIMProc) xic_preedit_caret_callback }; static XIMCallback Xxic_preedit_done_callback = { NULL, (XIMProc) xic_preedit_done_callback }; -static XIMCallback Xxic_preedit_start_callback = { NULL, - (void *) xic_preedit_start_callback }; +static XICCallback Xxic_preedit_start_callback = { NULL, + (XICProc) xic_preedit_start_callback }; #if defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT /* Create an X fontset on frame F with base font name BASE_FONTNAME. */