On 26-Nov-2017 01:20, Bram Moolenaar wrote:
Patch 8.0.1336
Problem: Cannot use imactivatefunc() unless compiled with +xim.
Solution: Allow using imactivatefunc() when not compiled with +xim.
(Yasuhiro Matsumoto, closes #2349)
Files: runtime/doc/options.txt, runtime/doc/mbyte.txt, src/mbyte.c,
src/option.c, src/option.h, src/structs.h,
src/testdir/test_iminsert.vim, src/Makefile,
src/testdir/Make_all.mak, src/vim.h
After the patch series that deals with imactivatefunc (starting with
1336), I get a build failure on HP-UX if FEAT_MBYTE is disabled, like so:
cc -c -I. -Iproto -DHAVE_CONFIG_H -O2 -o objects/mbyte.o
mbyte.c
cc: "mbyte.c", line 4803: error 1588: "p_imaf" undefined.
cc: "mbyte.c", line 4803: warning 563: Argument #1 is not the correct type.
cc: "mbyte.c", line 4803: warning 527: Integral value implicitly
converted to pointer in assignment.
cc: "mbyte.c", line 4803: warning 563: Argument #2 is not the correct type.
cc: "mbyte.c", line 4803: warning 526: Pointer implicitly converted to
integral value in assignment.
cc: "mbyte.c", line 4803: warning 563: Argument #3 is not the correct type.
cc: "mbyte.c", line 4821: error 1588: "p_imsf" undefined.
cc: "mbyte.c", line 4821: warning 563: Argument #1 is not the correct type.
cc: "mbyte.c", line 6490: error 1588: "p_imsf" undefined.
cc: "mbyte.c", line 6490: error 1554: Indirection must be through a pointer.
cc: "mbyte.c", line 6490: error 1563: Expression in if must be scalar.
*** Error exit code 1
Stop.
*** Error exit code 1
Stop.
The variable "p_imaf" is declared in option.h only if FEAT_EVAL and
FEAT_MBYTE are defined, but mbyte.c (line 4786 et al) references it
without checking them both. I have prepared a patch that attempts to fix
it, please check.
Cheers
John
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
--- mbyte.c.orig 2017-11-27 05:11:30.086745600 +1100
+++ mbyte.c 2017-11-27 14:42:38.803274700 +1100
@@ -4782,6 +4782,7 @@
#endif /* FEAT_MBYTE */
+#if defined(FEAT_EVAL) && defined(FEAT_MBYTE)
#ifdef FEAT_GUI
# define USE_IMACTIVATEFUNC (!gui.in_use && *p_imaf != NUL)
# define USE_IMSTATUSFUNC (!gui.in_use && *p_imsf != NUL)
@@ -4790,7 +4791,6 @@
# define USE_IMSTATUSFUNC (*p_imsf != NUL)
#endif
-#ifdef FEAT_EVAL
static void
call_imactivatefunc(int active)
{
@@ -5696,7 +5696,7 @@
void
xim_reset(void)
{
-#ifdef FEAT_EVAL
+#if defined(FEAT_EVAL) && defined(FEAT_MBYTE)
if (USE_IMACTIVATEFUNC)
call_imactivatefunc(im_is_active);
else
@@ -5875,7 +5875,7 @@
int
im_get_status(void)
{
-# ifdef FEAT_EVAL
+# if defined(FEAT_EVAL) && defined(FEAT_MBYTE)
if (USE_IMSTATUSFUNC)
return call_imstatusfunc();
# endif
@@ -5922,7 +5922,7 @@
* all the time, like it was done in Vim 5.8. */
active = TRUE;
-# if defined(FEAT_EVAL)
+# if defined(FEAT_EVAL) && defined(FEAT_MBYTE)
if (USE_IMACTIVATEFUNC)
{
if (active != im_get_status())
@@ -6354,7 +6354,7 @@
int
im_get_status(void)
{
-# ifdef FEAT_EVAL
+# if defined(FEAT_EVAL) && defined(FEAT_MBYTE)
if (USE_IMSTATUSFUNC)
return call_imstatusfunc();
# endif
@@ -6486,7 +6486,7 @@
int
im_get_status()
{
-# ifdef FEAT_EVAL
+# if defined(FEAT_EVAL) && defined(FEAT_MBYTE)
if (USE_IMSTATUSFUNC)
return call_imstatusfunc();
# endif
@@ -6496,7 +6496,7 @@
void
im_set_active(int active_arg)
{
-# if defined(FEAT_MBYTE) && defined(FEAT_EVAL)
+# if defined(FEAT_EVAL) && defined(FEAT_MBYTE)
int active = !p_imdisable && active_arg;
if (USE_IMACTIVATEFUNC && active != im_get_status())