On 05-Mar.-2018 04:08, Bram Moolenaar wrote:
Patch 8.0.1564
Problem:    Too many #ifdefs.
Solution:   Graduate the +autocmd feature. Takes away 450 #ifdefs and
             increases code size of tiny Vim by only 40 Kbyte.
Files:      src/buffer.c, src/diff.c, src/edit.c, src/eval.c, src/evalfunc.c,
             src/ex_cmds.c, src/ex_cmds2.c, src/ex_docmd.c, src/ex_getln.c,
             src/fileio.c, src/getchar.c, src/globals.h, src/gui.c,
             src/if_cscope.c, src/if_xcmdsrv.c, src/main.c, src/mbyte.c,
             src/memline.c, src/menu.c, src/misc1.c, src/gui_mac.c,
             src/misc2.c, src/move.c, src/netbeans.c, src/normal.c, src/ops.c,
             src/option.c, src/option.h, src/feature.h, src/vim.h,
             src/os_amiga.c, src/os_mswin.c, src/os_unix.c, src/os_win32.c,
             src/quickfix.c, src/screen.c, src/search.c, src/spell.c,
             src/structs.h, src/syntax.c, src/tag.c, src/term.c,
             src/terminal.c, src/ui.c, src/undo.c, src/userfunc.c,
             src/version.c, src/window.c


After this patch (and still with 8.0.1566), mingw64 throws this linker error when building a GUI (with FEAT_MBYTE on but with FEAT_MBYTE_IME and DYNAMIC_IME off):
<snip>
...
gcc -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -DFEAT_DIRECTX -DDYNAMIC_DIRECTX -DFEAT_DIRECTX_COLOR_EMOJI -DFEAT_GUI_W32 -DFEAT_CLIPBOARD -DFEAT_MBYTE -pipe -march=native -Wall -O3 -fomit-frame-pointer -freg-struct-return -s -Wl,-nxcompat,-dynamicbase -mwindows -o gvim.exe gobjnative/arabic.o gobjnative/beval.o gobjnative/blowfish.o gobjnative/buffer.o gobjnative/charset.o gobjnative/crypt.o gobjnative/crypt_zip.o gobjnative/dict.o gobjnative/diff.o gobjnative/digraph.o gobjnative/edit.o gobjnative/eval.o gobjnative/evalfunc.o gobjnative/ex_cmds.o gobjnative/ex_cmds2.o gobjnative/ex_docmd.o gobjnative/ex_eval.o gobjnative/ex_getln.o gobjnative/farsi.o gobjnative/fileio.o gobjnative/fold.o gobjnative/getchar.o gobjnative/hardcopy.o gobjnative/hashtab.o gobjnative/json.o gobjnative/list.o gobjnative/main.o gobjnative/mark.o gobjnative/memfile.o gobjnative/memline.o gobjnative/menu.o gobjnative/message.o gobjnative/misc1.o gobjnative/misc2.o gobjnative/move.o gobjnative/mbyte.o gobjnative/normal.o gobjnative/ops.o gobjnative/option.o gobjnative/os_win32.o gobjnative/os_mswin.o gobjnative/winclip.o gobjnative/pathdef.o gobjnative/popupmnu.o gobjnative/quickfix.o gobjnative/regexp.o gobjnative/screen.o gobjnative/search.o gobjnative/sha256.o gobjnative/spell.o gobjnative/spellfile.o gobjnative/syntax.o gobjnative/tag.o gobjnative/term.o gobjnative/ui.o gobjnative/undo.o gobjnative/userfunc.o gobjnative/version.o gobjnative/vimrc.o gobjnative/window.o gobjnative/gui_dwrite.o gobjnative/gui.o gobjnative/gui_w32.o gobjnative/gui_beval.o gobjnative/os_w32exe.o -lkernel32 -luser32 -lgdi32 -ladvapi32 -lcomdlg32 -lcomctl32 -lversion -ld2d1 -ldwrite -lstdc++ -lole32 -luuid gobjnative/edit.o:edit.c:(.text+0xd182): undefined reference to `im_set_active' gobjnative/edit.o:edit.c:(.text+0xdb21): undefined reference to `im_set_active' gobjnative/edit.o:edit.c:(.text+0xfc8f): undefined reference to `im_get_status' gobjnative/edit.o:edit.c:(.text+0xfcac): undefined reference to `im_set_active' gobjnative/edit.o:edit.c:(.text+0x10154): undefined reference to `im_set_active' gobjnative/edit.o:edit.c:(.text+0x10174): undefined reference to `im_set_active' gobjnative/edit.o:edit.c:(.text+0x101a5): undefined reference to `im_get_status' gobjnative/edit.o:edit.c:(.text+0x101d3): undefined reference to `im_set_active' gobjnative/ex_getln.o:ex_getln.c:(.text+0x7f3d): undefined reference to `im_set_active' gobjnative/ex_getln.o:ex_getln.c:(.text+0x8c34): undefined reference to `im_set_active' gobjnative/ex_getln.o:ex_getln.c:(.text+0x9a2c): undefined reference to `im_set_active' gobjnative/ex_getln.o:ex_getln.c:(.text+0xa35a): undefined reference to `im_set_active' gobjnative/ex_getln.o:ex_getln.c:(.text+0xab0b): undefined reference to `im_get_status' gobjnative/ex_getln.o:ex_getln.c:(.text+0xab1a): undefined reference to `im_set_active' gobjnative/ex_getln.o:ex_getln.c:(.text+0xab3f): undefined reference to `im_set_active' gobjnative/ex_getln.o:ex_getln.c:(.text+0xb1e3): undefined reference to `im_set_active' gobjnative/ex_getln.o:ex_getln.c:(.text+0xb200): undefined reference to `im_set_active' gobjnative/getchar.o:getchar.c:(.text+0x56f6): undefined reference to `im_get_status' gobjnative/normal.o:normal.c:(.text+0xfa8a): undefined reference to `im_set_active' gobjnative/normal.o:normal.c:(.text+0xfb53): undefined reference to `im_set_active' gobjnative/option.o:option.c:(.text+0xc1b5): undefined reference to `im_set_active' gobjnative/option.o:option.c:(.text+0xced3): undefined reference to `im_set_active' gobjnative/gui.o:gui.c:(.text+0x26f2): undefined reference to `im_set_position' gobjnative/gui.o:gui.c:(.text+0x29c7): undefined reference to `im_get_status' gobjnative/gui.o:gui.c:(.text+0x2ec3): undefined reference to `im_set_position' gobjnative/gui.o:gui.c:(.text+0x3154): undefined reference to `im_get_status'
collect2.exe: error: ld returned 1 exit status
make: *** [Make_cyg_ming.mak:884: gvim.exe] Error 1
</snip>

Turning on FEAT_MBYTE_IME (but leaving DYNAMIC_IME off) allows the build to complete, but with these warnings:
<snip>
...
gui_w32.c: In function '_OnImeNotify':
gui_w32.c:5835:9: warning: the address of 'ImmGetContext' will always evaluate as 'true' [-Waddress]
     if (!pImmGetContext || (hImc = pImmGetContext(hWnd)) == (HIMC)0)
^
gui_w32.c: In function 'GetCompositionString_inUCS2':
gui_w32.c:5909:9: warning: the address of 'ImmGetContext' will always evaluate as 'true' [-Waddress]
     if (!pImmGetContext)
^
gui_w32.c: In function 'GetResultStr':
gui_w32.c:5961:9: warning: the address of 'ImmGetContext' will always evaluate as 'true' [-Waddress]
     if (!pImmGetContext || (hIMC = pImmGetContext(hwnd)) == (HIMC)0)
^
gui_w32.c: In function 'im_set_font':
gui_w32.c:4510:28: warning: the address of 'ImmGetContext' will always evaluate as 'true' [-Waddress]
 # define pImmGetContext ImmGetContext
^
gui_w32.c:4510:28: note: in definition of macro 'pImmGetContext'
 # define pImmGetContext ImmGetContext
^~~~~~~~~~~~~
gui_w32.c: In function 'im_set_position':
gui_w32.c:4510:28: warning: the address of 'ImmGetContext' will always evaluate as 'true' [-Waddress]
 # define pImmGetContext ImmGetContext
^
gui_w32.c:4510:28: note: in definition of macro 'pImmGetContext'
 # define pImmGetContext ImmGetContext
^~~~~~~~~~~~~
gui_w32.c: In function 'im_set_active':
gui_w32.c:4510:28: warning: the address of 'ImmGetContext' will always evaluate as 'true' [-Waddress]
 # define pImmGetContext ImmGetContext
^
gui_w32.c:4510:28: note: in definition of macro 'pImmGetContext'
 # define pImmGetContext ImmGetContext
^~~~~~~~~~~~~
gui_w32.c: In function 'im_get_status':
gui_w32.c:4510:28: warning: the address of 'ImmGetContext' will always evaluate as 'true' [-Waddress]
 # define pImmGetContext ImmGetContext
^
gui_w32.c:4510:28: note: in definition of macro 'pImmGetContext'
 # define pImmGetContext ImmGetContext
^~~~~~~~~~~~~
</snip>

Finally, turning on DYNAMIC_IME removes the warnings.
I suspect that the problem lies in the changes to vim.h (the new lines between line 2121 and 2136), but I don't have a patch at the moment.

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.

Raspunde prin e-mail lui