On 11-Jan-2021 06:23, Bram Moolenaar wrote:
Patch 8.2.2324
Problem:    Not easy to get mark en cursor posotion by character count.
Solution:   Add functions that use character index. (Yegappan Lakshmanan,
             closes #7648)
Files:      runtime/doc/eval.txt, runtime/doc/usr_41.txt, src/eval.c,
             src/evalfunc.c, src/proto/eval.pro, src/tag.c,
             src/testdir/test_cursor_func.vim, src/typval.c


After this patch, mingw64 (gcc 10.2) spits out this linker error if FEAT_SPELL is not defined:
<snip>
gcc -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO -pipe -march=native -Wall -O3 -fomit-frame-pointer -freg-struct-return -fpie -fPIE -DFEAT_GUI_MSWIN -DFEAT_CLIPBOARD -Wl,-nxcompat,-dynamicbase -municode -s -mwindows -o gvim.exe gobjnative/arabic.o gobjnative/arglist.o gobjnative/autocmd.o gobjnative/beval.o gobjnative/blob.o gobjnative/blowfish.o gobjnative/buffer.o gobjnative/bufwrite.o gobjnative/change.o gobjnative/charset.o gobjnative/cindent.o gobjnative/clientserver.o gobjnative/clipboard.o gobjnative/cmdexpand.o gobjnative/cmdhist.o gobjnative/crypt.o gobjnative/crypt_zip.o gobjnative/debugger.o gobjnative/dict.o gobjnative/diff.o gobjnative/digraph.o gobjnative/drawline.o gobjnative/drawscreen.o gobjnative/edit.o gobjnative/eval.o gobjnative/evalbuffer.o gobjnative/evalfunc.o gobjnative/evalvars.o gobjnative/evalwindow.o gobjnative/ex_cmds.o gobjnative/ex_cmds2.o gobjnative/ex_docmd.o gobjnative/ex_eval.o gobjnative/ex_getln.o gobjnative/fileio.o gobjnative/filepath.o gobjnative/findfile.o gobjnative/fold.o gobjnative/getchar.o gobjnative/gui_xim.o gobjnative/hardcopy.o gobjnative/hashtab.o gobjnative/help.o gobjnative/highlight.o gobjnative/if_cscope.o gobjnative/indent.o gobjnative/insexpand.o gobjnative/json.o gobjnative/list.o gobjnative/locale.o gobjnative/main.o gobjnative/map.o gobjnative/mark.o gobjnative/match.o gobjnative/memfile.o gobjnative/memline.o gobjnative/menu.o gobjnative/message.o gobjnative/misc1.o gobjnative/misc2.o gobjnative/mouse.o gobjnative/move.o gobjnative/mbyte.o gobjnative/normal.o gobjnative/ops.o gobjnative/option.o gobjnative/optionstr.o gobjnative/os_mswin.o gobjnative/os_win32.o gobjnative/pathdef.o gobjnative/popupmenu.o gobjnative/popupwin.o gobjnative/profiler.o gobjnative/quickfix.o gobjnative/regexp.o gobjnative/register.o gobjnative/scriptfile.o gobjnative/screen.o gobjnative/search.o gobjnative/session.o gobjnative/sha256.o gobjnative/sign.o gobjnative/spell.o gobjnative/spellfile.o gobjnative/spellsuggest.o gobjnative/syntax.o gobjnative/tag.o gobjnative/term.o gobjnative/testing.o gobjnative/textformat.o gobjnative/textobject.o gobjnative/textprop.o gobjnative/time.o gobjnative/typval.o gobjnative/ui.o gobjnative/undo.o gobjnative/usercmd.o gobjnative/userfunc.o gobjnative/version.o gobjnative/vim9compile.o gobjnative/vim9execute.o gobjnative/vim9script.o gobjnative/vim9type.o gobjnative/viminfo.o gobjnative/winclip.o gobjnative/window.o gobjnative/os_w32exe.o gobjnative/vimrc.o gobjnative/xdiffi.o gobjnative/xemit.o gobjnative/xprepare.o gobjnative/xutils.o gobjnative/xhistogram.o gobjnative/xpatience.o gobjnative/gui.o gobjnative/gui_w32.o gobjnative/gui_beval.o -lkernel32 -luser32 -lgdi32 -ladvapi32 -lcomdlg32 -lcomctl32 -lnetapi32 -lversion -lole32 -luuid d:/users/john/documents/software/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gobjnative/eval.o:eval.c:(.text+0x44a6): undefined reference to `mb_charlen_len' d:/users/john/documents/software/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gobjnative/eval.o:eval.c:(.text+0x461e): undefined reference to `mb_charlen_len' d:/users/john/documents/software/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gobjnative/eval.o:eval.c:(.text+0x41c9): undefined reference to `mb_charlen_len'
collect2.exe: error: ld returned 1 exit status
make: *** [Make_cyg_ming.mak:1075: gvim.exe] Error 1
</snip>

The function mb_charlen_len() is defined conditionally (dependent on FEAT_SPELL being defined) in mbyte.c.
The attached patch tries to fix it.

Cheers

--
--
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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/321ffdf0-979f-25a3-448a-51004fecf9e0%40internode.on.net.
--- mbyte.c.orig        2020-12-10 05:22:06.686347500 +1100
+++ mbyte.c     2021-01-11 06:29:42.618284300 +1100
@@ -4299,7 +4299,6 @@
     return count;
 }
 
-#if defined(FEAT_SPELL) || defined(PROTO)
 /*
  * Like mb_charlen() but for a string with specified length.
  */
@@ -4314,7 +4313,6 @@
 
     return count;
 }
-#endif
 
 /*
  * Try to un-escape a multi-byte character.

Raspunde prin e-mail lui