emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master ec403abc60: Improve portability of X11 IM code


From: Po Lu
Subject: master ec403abc60: Improve portability of X11 IM code
Date: Mon, 24 Jan 2022 22:50:47 -0500 (EST)

branch: master
commit ec403abc6078e2236762d85fe206703602014377
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    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.
---
 configure.ac | 1 +
 src/xfns.c   | 9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index e5574b6b05..ae92b85be1 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 <X11/Xlib.h>])
     ## 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 bb1e431ff8..faab1b1158 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.  */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]