On 27-Apr-2016 4:59 AM, Bram Moolenaar wrote:
Patch 7.4.1792
Problem: Color name decoding is implemented several times.
Solution: Move it to term.c. (Christian Brabandt)
Files: src/gui_mac.c, src/gui_photon.c, src/gui_w32.c,
src/proto/term.pro, src/term.c
This patch throws an error and a warning (using mingw64).
The error looks like this:
...
gcc -c -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603
-DHAVE_PATHDEF -DFEAT_NORMAL -DFEAT_GUI_W32 -DFEAT_CLIPBOAR
D -pipe -march=native -Wall -O3 -fomit-frame-pointer -freg-struct-return
-s gui_w32.c -o gobjnative/gui_w32.o
gui_w32.c: In function 'gui_mch_get_color':
gui_w32.c:1614:10: error: 'i' undeclared (first use in this function)
for (i = 0; i < sizeof(sys_table) / sizeof(sys_table[0]); i++)
^
gui_w32.c:1614:10: note: each undeclared identifier is reported only
once for each function it appears in
...
The warning like this:
...
term.c: In function 'gui_get_color_cmn':
term.c:6071:0: warning: "RGB" redefined
#define RGB(r, g, b) ((r<<16) | (g<<8) | (b))
^
In file included from
C:/Programs/MinGW64/x86_64-w64-mingw32/include/windows.h:71:0,
from os_win32.h:103,
from vim.h:291,
from term.c:26:
C:/Programs/MinGW64/x86_64-w64-mingw32/include/wingdi.h:1395:0: note:
this is the location of the previous definition
#define RGB(r,g,b)
((COLORREF)(((BYTE)(r)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(b))<<16)))
^
...
The attached patch fixes the error. Not sure about the warning...perhaps
using the definition from windgi.h would do the trick?
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 [email protected].
For more options, visit https://groups.google.com/d/optout.
--- gui_w32_orig.c 2016-04-27 05:06:08.964760000 +1000
+++ gui_w32.c 2016-04-27 05:16:46.211336000 +1000
@@ -1562,6 +1562,7 @@
guicolor_T
gui_mch_get_color(char_u *name)
{
+ int i;
typedef struct SysColorTable
{