On 26-Nov-2017 03:14, Bram Moolenaar wrote:
Patch 8.0.1338 (after 8.0.1337)
Problem:    USE_IM_CONTROL is confusing and incomplete.
Solution:   Just use FEAT_MBYTE.  Call 'imactivatefunc' also without GUI.
Files:      src/vim.h, src/edit.c, src/ex_getln.c, src/getchar.c, src/gui.c,
             src/gui_mac.c, src/gui_w32.c, src/mbyte.c, src/normal.c,
             src/option.c, src/ui.c, src/globals.h, src/option.h
This patch causes mingw64 to throw this warning if FEAT_MBYTE is defined but FEAT_MBYTE_IME is not: gcc -c -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -DFEAT_GUI_W32 -DFEAT_CLIPBOARD -pipe -march=native -Wall -O3 -fomit-frame-pointer -freg-struct-return -s gui_w32.c -o gobjnative/gui_w32.o gui_w32.c:505:16: warning: 'sub_logfont' defined but not used [-Wunused-variable]
 static LOGFONT sub_logfont;
                ^~~~~~~~~~~
gui_w32.c:503:16: warning: 'norm_logfont' defined but not used [-Wunused-variable]
 static LOGFONT norm_logfont;
                ^~~~~~~~~~~~

sub_logfont and norm_logfont are defined depending on FEAT_MBYTE but is then used in function _OnImeNotify() which is defined depending on FEAT_MBYTE_IME and FEAT_MBYTE and FEAT_MBYTE_IME do not depend on each other, at least in Make_cyg_ming.mak anyway.

The attached patch tries to fix it by adjusting the ifdefs in gui_w32.c, 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.
--- gui_w32.c.orig      2017-11-27 05:11:30.084744900 +1100
+++ gui_w32.c   2017-11-27 14:28:54.629587700 +1100
@@ -498,14 +498,12 @@
  *
  * These LOGFONT used for IME.
  */
-#ifdef FEAT_MBYTE
+#if defined(FEAT_MBYTE) && (defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME))
 /* holds LOGFONT for 'guifontwide' if available, otherwise 'guifont' */
 static LOGFONT norm_logfont;
 /* holds LOGFONT for 'guifont' always. */
 static LOGFONT sub_logfont;
-#endif
 
-#ifdef FEAT_MBYTE_IME
 static LRESULT _OnImeNotify(HWND hWnd, DWORD dwCommand, DWORD dwData);
 #endif
 
@@ -2005,14 +2003,14 @@
                MyTranslateMessage(&msg);
        }
     }
-#ifdef FEAT_MBYTE_IME
+#if defined(FEAT_MBYTE) && (defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME))
     else if (msg.message == WM_IME_NOTIFY)
        _OnImeNotify(msg.hwnd, (DWORD)msg.wParam, (DWORD)msg.lParam);
     else if (msg.message == WM_KEYUP && im_get_status())
        /* added for non-MS IME (Yasuhiro Matsumoto) */
        MyTranslateMessage(&msg);
 #endif
-#if !defined(FEAT_MBYTE_IME) && defined(GLOBAL_IME)
+#if defined(FEAT_MBYTE) && !defined(FEAT_MBYTE_IME) && defined(GLOBAL_IME)
 /* GIME_TEST */
     else if (msg.message == WM_IME_STARTCOMPOSITION)
     {
@@ -3277,7 +3275,7 @@
 }
 
 
-#ifdef FEAT_MBYTE_IME
+#if defined(FEAT_MBYTE) && (defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME))
 /*
  * Set correct LOGFONT to IME.  Use 'guifontwide' if available, otherwise use
  * 'guifont'
@@ -3359,7 +3357,7 @@
 
     if (font_name == NULL)
        font_name = (char_u *)lf.lfFaceName;
-#if defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME)
+#if defined(FEAT_MBYTE) && (defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME))
     norm_logfont = lf;
     sub_logfont = lf;
 #endif
@@ -5110,7 +5108,7 @@
        }
        /* break; notreached */
 
-#ifdef FEAT_MBYTE_IME
+#if defined(FEAT_MBYTE) && (defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME))
     case WM_IME_NOTIFY:
        if (!_OnImeNotify(hwnd, (DWORD)wParam, (DWORD)lParam))
            return MyWindowProc(hwnd, uMsg, wParam, lParam);
@@ -5794,7 +5792,7 @@
     gui.currSpColor = color;
 }
 
-#if defined(FEAT_MBYTE) && defined(FEAT_MBYTE_IME)
+#if defined(FEAT_MBYTE) && (defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME))
 /*
  * Multi-byte handling, originally by Sung-Hoon Baek.
  * First static functions (no prototypes generated).

Raspunde prin e-mail lui