Hi all,
It seems that following change from last Friday broke Solaris build:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=185157cb6eb25bc5e75e9a...
This is probably because Solaris /usr/include/X11/Xlib.h doesn't define XICCallback.
-bash-3.2$ grep XICCallback /usr/include/X11/Xlib.h -bash-3.2$
Compilation error is following:
gcc -c -I. -I. -I../../include -I../../include -D__WINESRC__ -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith -std=gnu99 -o xim.o xim.c xim.c: In function `X11DRV_DestroyIM': xim.c:371: warning: passing arg 5 of `XRegisterIMInstantiateCallback' from incompatible pointer type xim.c: In function `X11DRV_OpenIM': xim.c:398: warning: assignment from incompatible pointer type xim.c:475: warning: passing arg 5 of `XUnregisterIMInstantiateCallback' from incompatible pointer type xim.c: In function `X11DRV_SetupXIM': xim.c:485: warning: passing arg 5 of `XRegisterIMInstantiateCallback' from incompatible pointer type xim.c: In function `X11DRV_CreateIC': xim.c:504: error: `XICCallback' undeclared (first use in this function) xim.c:504: error: (Each undeclared identifier is reported only once xim.c:504: error: for each function it appears in.) xim.c:504: error: syntax error before "destroy" xim.c:500: warning: unused variable `spot' xim.c:501: warning: unused variable `preedit' xim.c:502: warning: unused variable `status' xim.c:503: warning: unused variable `xic' ...
Any idea or comment to this?
Thanks,
Petr
Does this patch fix the problem?
diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c index d4df9f7..b66cf87 100644 --- a/dlls/winex11.drv/xim.c +++ b/dlls/winex11.drv/xim.c @@ -501,7 +501,7 @@ XIC X11DRV_CreateIC(XIM xim, struct x11drv_win_data *data) XVaNestedList preedit = NULL; XVaNestedList status = NULL; XIC xic; - XICCallback destroy = {(XPointer)data, X11DRV_DestroyIC}; + XIMCallback destroy = {(XPointer)data, (XIMProc)X11DRV_DestroyIC}; XIMCallback P_StartCB; XIMCallback P_DoneCB; XIMCallback P_DrawCB;
Kusanagi Kouichi wrote:
Does this patch fix the problem?
- XICCallback destroy = {(XPointer)data, X11DRV_DestroyIC};
- XIMCallback destroy = {(XPointer)data, (XIMProc)X11DRV_DestroyIC};
I think a configure check may be a more appropriate fix.
On Mon, Apr 14, 2008 at 06:36:44PM +0100, Robert Shearman wrote:
I think a configure check may be a more appropriate fix.
I don't know proper way to check whether XICCallback is defined. But this seems to work.
diff --git a/configure b/configure index b66a40a..01fdf19 100755 --- a/configure +++ b/configure @@ -10686,6 +10686,115 @@ esac fi
+ { echo "$as_me:$LINENO: checking for XICCallback.callback" >&5 +echo $ECHO_N "checking for XICCallback.callback... $ECHO_C" >&6; } +if test "${ac_cv_member_XICCallback_callback+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef HAVE_X11_XLIB_H +#include <X11/Xlib.h> +#endif + +int +main () +{ +static XICCallback ac_aggr; +if (ac_aggr.callback) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *"* | *`* | *\*) ac_try_echo=$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo "$as_me:$LINENO: $ac_try_echo"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: $? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_member_XICCallback_callback=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef HAVE_X11_XLIB_H +#include <X11/Xlib.h> +#endif + +int +main () +{ +static XICCallback ac_aggr; +if (sizeof ac_aggr.callback) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *"* | *`* | *\*) ac_try_echo=$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo "$as_me:$LINENO: $ac_try_echo"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: $? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_member_XICCallback_callback=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_member_XICCallback_callback=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_member_XICCallback_callback" >&5 +echo "${ECHO_T}$ac_cv_member_XICCallback_callback" >&6; } +if test $ac_cv_member_XICCallback_callback = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_XICCALLBACK_CALLBACK 1 +_ACEOF + + +fi + +
opengl_msg="" if test "x$with_opengl" != "xno" diff --git a/configure.ac b/configure.ac index e9dadee..b5c4bf2 100644 --- a/configure.ac +++ b/configure.ac @@ -698,6 +698,12 @@ then WINE_NOTICE_WITH(xcomposite,[test "x$ac_cv_lib_soname_Xcomposite" = "x"], [libxcomposite development files not found, Xcomposite won't be supported.])
+ dnl *** Check for XICCallback struct + AC_CHECK_MEMBERS([XICCallback.callback],,, +[#ifdef HAVE_X11_XLIB_H +#include <X11/Xlib.h> +#endif]) + dnl *** End of X11/Xlib.h check
dnl Check for the presence of OpenGL diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c index d4df9f7..85d37e8 100644 --- a/dlls/winex11.drv/xim.c +++ b/dlls/winex11.drv/xim.c @@ -501,11 +501,13 @@ XIC X11DRV_CreateIC(XIM xim, struct x11drv_win_data *data) XVaNestedList preedit = NULL; XVaNestedList status = NULL; XIC xic; - XICCallback destroy = {(XPointer)data, X11DRV_DestroyIC}; - XIMCallback P_StartCB; - XIMCallback P_DoneCB; - XIMCallback P_DrawCB; - XIMCallback P_CaretCB; +#ifdef HAVE_XICCALLBACK_CALLBACK + XICCallback destroy = {(XPointer)data, (XICProc)X11DRV_DestroyIC}; + XICCallback P_StartCB, P_DoneCB, P_DrawCB, P_CaretCB; +#else + XIMCallback destroy = {(XPointer)data, (XIMProc)X11DRV_DestroyIC}; + XIMCallback P_StartCB, P_DoneCB, P_DrawCB, P_CaretCB; +#endif LANGID langid = PRIMARYLANGID(LANGIDFROMLCID(GetThreadLocale())); Window win = data->whole_window;
@@ -531,13 +533,20 @@ XIC X11DRV_CreateIC(XIM xim, struct x11drv_win_data *data)
/* create callbacks */ P_StartCB.client_data = NULL; - P_StartCB.callback = (XIMProc)XIMPreEditStartCallback; P_DoneCB.client_data = NULL; - P_DoneCB.callback = (XIMProc)XIMPreEditDoneCallback; P_DrawCB.client_data = NULL; - P_DrawCB.callback = (XIMProc)XIMPreEditDrawCallback; P_CaretCB.client_data = NULL; +#ifdef HAVE_XICCALLBACK_CALLBACK + P_StartCB.callback = (XICProc)XIMPreEditStartCallback; + P_DoneCB.callback = (XICProc)XIMPreEditDoneCallback; + P_DrawCB.callback = (XICProc)XIMPreEditDrawCallback; + P_CaretCB.callback = (XICProc)XIMPreEditCaretCallback; +#else + P_StartCB.callback = (XIMProc)XIMPreEditStartCallback; + P_DoneCB.callback = (XIMProc)XIMPreEditDoneCallback; + P_DrawCB.callback = (XIMProc)XIMPreEditDrawCallback; P_CaretCB.callback = (XIMProc)XIMPreEditCaretCallback; +#endif
if ((ximStyle & (XIMPreeditNothing | XIMPreeditNone)) == 0) { diff --git a/include/config.h.in b/include/config.h.in index ac464db..f867662 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -945,6 +945,9 @@ /* Define to 1 if you have the <X11/Xutil.h> header file. */ #undef HAVE_X11_XUTIL_H
+/* Define to 1 if `callback' is member of `XICCallback'. */ +#undef HAVE_XICCALLBACK_CALLBACK + /* Define if you have the XKB extension */ #undef HAVE_XKB
Kusanagi Kouichi slash@ma.neweb.ne.jp writes:
On Mon, Apr 14, 2008 at 06:36:44PM +0100, Robert Shearman wrote:
I think a configure check may be a more appropriate fix.
I don't know proper way to check whether XICCallback is defined. But this seems to work.
Is it just the type that is not defined, or is the callback feature itself not supported?
On Mon, Apr 14, 2008 at 11:11:46PM +0200, Alexandre Julliard wrote:
Kusanagi Kouichi slash@ma.neweb.ne.jp writes:
On Mon, Apr 14, 2008 at 06:36:44PM +0100, Robert Shearman wrote:
I think a configure check may be a more appropriate fix.
I don't know proper way to check whether XICCallback is defined. But this seems to work.
Is it just the type that is not defined, or is the callback feature itself not supported?
Solaris ought to support callback. Thus existence of XICCallback will be irrelevant to callback functionality.
This works properly on Solaris. Please submit patch if everybody is happy with it.
Thanks,
Petr
Kusanagi Kouichi wrote:
On Mon, Apr 14, 2008 at 06:36:44PM +0100, Robert Shearman wrote:
I think a configure check may be a more appropriate fix.
I don't know proper way to check whether XICCallback is defined. But this seems to work.
diff --git a/configure b/configure index b66a40a..01fdf19 100755 --- a/configure +++ b/configure @@ -10686,6 +10686,115 @@ esac fi
{ echo "$as_me:$LINENO: checking for XICCallback.callback" >&5
+echo $ECHO_N "checking for XICCallback.callback... $ECHO_C" >&6; } +if test "${ac_cv_member_XICCallback_callback+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+else
- cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef HAVE_X11_XLIB_H +#include <X11/Xlib.h> +#endif
+int +main () +{ +static XICCallback ac_aggr; +if (ac_aggr.callback) +return 0;
- ;
- return 0;
+} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in
- *"* | *`* | *\*) ac_try_echo=$ac_try;;
- *) ac_try_echo=$ac_try;;
+esac +eval "echo "$as_me:$LINENO: $ac_try_echo"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: $? = $ac_status" >&5
- (exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
- ac_cv_member_XICCallback_callback=yes
+else
- echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef HAVE_X11_XLIB_H +#include <X11/Xlib.h> +#endif
+int +main () +{ +static XICCallback ac_aggr; +if (sizeof ac_aggr.callback) +return 0;
- ;
- return 0;
+} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in
- *"* | *`* | *\*) ac_try_echo=$ac_try;;
- *) ac_try_echo=$ac_try;;
+esac +eval "echo "$as_me:$LINENO: $ac_try_echo"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: $? = $ac_status" >&5
- (exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
- ac_cv_member_XICCallback_callback=yes
+else
- echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_member_XICCallback_callback=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_member_XICCallback_callback" >&5 +echo "${ECHO_T}$ac_cv_member_XICCallback_callback" >&6; } +if test $ac_cv_member_XICCallback_callback = yes; then
+cat >>confdefs.h <<_ACEOF +#define HAVE_XICCALLBACK_CALLBACK 1 +_ACEOF
+fi
opengl_msg=""
if test "x$with_opengl" != "xno"
diff --git a/configure.ac b/configure.ac index e9dadee..b5c4bf2 100644 --- a/configure.ac +++ b/configure.ac @@ -698,6 +698,12 @@ then WINE_NOTICE_WITH(xcomposite,[test "x$ac_cv_lib_soname_Xcomposite" = "x"], [libxcomposite development files not found, Xcomposite won't be supported.])
dnl *** Check for XICCallback struct
AC_CHECK_MEMBERS([XICCallback.callback],,,
+[#ifdef HAVE_X11_XLIB_H +#include <X11/Xlib.h> +#endif])
dnl *** End of X11/Xlib.h check
dnl Check for the presence of OpenGL
diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c index d4df9f7..85d37e8 100644 --- a/dlls/winex11.drv/xim.c +++ b/dlls/winex11.drv/xim.c @@ -501,11 +501,13 @@ XIC X11DRV_CreateIC(XIM xim, struct x11drv_win_data *data) XVaNestedList preedit = NULL; XVaNestedList status = NULL; XIC xic;
- XICCallback destroy = {(XPointer)data, X11DRV_DestroyIC};
- XIMCallback P_StartCB;
- XIMCallback P_DoneCB;
- XIMCallback P_DrawCB;
- XIMCallback P_CaretCB;
+#ifdef HAVE_XICCALLBACK_CALLBACK
- XICCallback destroy = {(XPointer)data, (XICProc)X11DRV_DestroyIC};
- XICCallback P_StartCB, P_DoneCB, P_DrawCB, P_CaretCB;
+#else
- XIMCallback destroy = {(XPointer)data, (XIMProc)X11DRV_DestroyIC};
- XIMCallback P_StartCB, P_DoneCB, P_DrawCB, P_CaretCB;
+#endif LANGID langid = PRIMARYLANGID(LANGIDFROMLCID(GetThreadLocale())); Window win = data->whole_window;
@@ -531,13 +533,20 @@ XIC X11DRV_CreateIC(XIM xim, struct x11drv_win_data *data)
/* create callbacks */ P_StartCB.client_data = NULL;
- P_StartCB.callback = (XIMProc)XIMPreEditStartCallback; P_DoneCB.client_data = NULL;
- P_DoneCB.callback = (XIMProc)XIMPreEditDoneCallback; P_DrawCB.client_data = NULL;
- P_DrawCB.callback = (XIMProc)XIMPreEditDrawCallback; P_CaretCB.client_data = NULL;
+#ifdef HAVE_XICCALLBACK_CALLBACK
- P_StartCB.callback = (XICProc)XIMPreEditStartCallback;
- P_DoneCB.callback = (XICProc)XIMPreEditDoneCallback;
- P_DrawCB.callback = (XICProc)XIMPreEditDrawCallback;
- P_CaretCB.callback = (XICProc)XIMPreEditCaretCallback;
+#else
- P_StartCB.callback = (XIMProc)XIMPreEditStartCallback;
- P_DoneCB.callback = (XIMProc)XIMPreEditDoneCallback;
- P_DrawCB.callback = (XIMProc)XIMPreEditDrawCallback; P_CaretCB.callback = (XIMProc)XIMPreEditCaretCallback;
+#endif
if ((ximStyle & (XIMPreeditNothing | XIMPreeditNone)) == 0) {
diff --git a/include/config.h.in b/include/config.h.in index ac464db..f867662 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -945,6 +945,9 @@ /* Define to 1 if you have the <X11/Xutil.h> header file. */ #undef HAVE_X11_XUTIL_H
+/* Define to 1 if `callback' is member of `XICCallback'. */ +#undef HAVE_XICCALLBACK_CALLBACK
/* Define if you have the XKB extension */ #undef HAVE_XKB
I can confirm that this works (I mean it compiles).
Thanks,
Petr
Kusanagi Kouichi wrote:
Does this patch fix the problem?
diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c index d4df9f7..b66cf87 100644 --- a/dlls/winex11.drv/xim.c +++ b/dlls/winex11.drv/xim.c @@ -501,7 +501,7 @@ XIC X11DRV_CreateIC(XIM xim, struct x11drv_win_data *data) XVaNestedList preedit = NULL; XVaNestedList status = NULL; XIC xic;
- XICCallback destroy = {(XPointer)data, X11DRV_DestroyIC};
- XIMCallback destroy = {(XPointer)data, (XIMProc)X11DRV_DestroyIC}; XIMCallback P_StartCB; XIMCallback P_DoneCB; XIMCallback P_DrawCB;