On 02-Mar-2022 06:23, Bram Moolenaar wrote:
Patch 8.2.4487
Problem: Vim9: cannot compare with v:null.
Solution: Allow comparing anything with v:null. (closes #9866)
Files: src/vim9instr.c, src/typval.c, src/proto/typval.pro,
src/vim9.h, src/vim9execute.c, src/evalvars.c,
src/testdir/test_vim9_expr.vim,
src/testdir/test_vim9_disassemble.vim
After this patch mingw64 (gcc 11.2.0) spits out this error if
FEAT_JOB_CHANNEL is not defined:
<snip>
gcc -c -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 typval.c -o
gobjnative/typval.o
typval.c: In function 'typval_compare_null':
typval.c:1397:46: error: 'union <anonymous>' has no member named 'v_channel'
1397 | case VAR_CHANNEL: return tv->vval.v_channel == NULL;
| ^
typval.c:1400:43: error: 'union <anonymous>' has no member named
'v_job'; did you mean 'v_blob'?
1400 | case VAR_JOB: return tv->vval.v_job == NULL;
| ^~~~~
| v_blob
make: *** [Make_cyg_ming.mak:1183: gobjnative/typval.o] Error 1
</snip>
The attached patch tries to fix it.
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/43c1a7a4-b200-ed83-de67-bc31cdbffdb0%40internode.on.net.
--- typval.c.orig 2022-03-02 06:31:51.382661100 +1100
+++ typval.c 2022-03-02 06:39:18.365574500 +1100
@@ -1394,10 +1394,14 @@
switch (tv->v_type)
{
case VAR_BLOB: return tv->vval.v_blob == NULL;
+#ifdef FEAT_JOB_CHANNEL
case VAR_CHANNEL: return tv->vval.v_channel == NULL;
+#endif
case VAR_DICT: return tv->vval.v_dict == NULL;
case VAR_FUNC: return tv->vval.v_string == NULL;
+#ifdef FEAT_JOB_CHANNEL
case VAR_JOB: return tv->vval.v_job == NULL;
+#endif
case VAR_LIST: return tv->vval.v_list == NULL;
case VAR_PARTIAL: return tv->vval.v_partial == NULL;
case VAR_STRING: return tv->vval.v_string == NULL;