Markus Trenkwalder wrote: > Suresh Govindachar wrote: > > Bram Moolenaar wrote: > > > Markus Trenkwalder wrote: > > > > > >> checked out vim-7.1a.001 today from svn (#263) and tried to > > >> compile it with mingw-gcc and got the following error: > > >> > > >> ----8<---- > > >> $ make -f Make_ming.mak > > >> gcc -c -Iproto -DWIN32 -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 > > >> -DHAVE_PATHDEF -DFEAT_BIG -DHAVE_GETTEXT -DHAVE_LOCALE_H > > >> -DDYNAMIC_GETTEXT -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG > > >> -DFEAT_GUI_W32 -DFEAT_CLIPBOARD -DFEAT_MBYTE -DFEAT_MBYTE_IME > > >> -DDYNAMIC_IME -DDYNAMIC_ICONV -pipe -w -march=i386 -Wall -O3 > > >> -fomit-frame-pointer -freg-struct-return -s gui_w32.c -o > > >> gobj/gui_w32.o gui_w32.c:236: error: redefinition of `struct > > >> tagNMTTDISPINFOA' gui_w32.c:246: error: redefinition of `struct > > >> tagNMTTDISPINFOW' make: *** [gobj/gui_w32.o] Error 1 ----8<---- > > > > I get the same error message. I recursively grepped for > > NMTTDISPINFO and examined the output, but did not find any > > "redefinition"! No clue where the compiler is finding the > > redefinitions. > > > > >> My naive solution to this problem is: > > >> ----8<---- > > >> --- src/gui_w32.c.000 Mon May 7 08:26:54 2007 > > >> +++ src/gui_w32.c Mon May 7 07:01:09 2007 > > >> @@ -232,7 +232,7 @@ > > >> LPARAM lParam; > > >> } NMTTDISPINFO_NEW; > > >> > > >> -#ifndef LPNMTTDISPINFO > > >> +#if !defined(LPNMTTDISPINFO) && !defined(TOOLTIPTEXTA) > > >> typedef struct tagNMTTDISPINFOA { > > >> NMHDR hdr; > > >> LPSTR lpszText; > > >> ----8<---- > > > > > > What does TOOLTIPTEXTA have to do with this? I don't understand > > > why you try to solve it this way. > > > > > > Someone else also reported this problem while it worked OK > > > earlier. Perhaps there is something wrong with the way you > > > obtained the sources? > > > > (Tony reported working around the error message by not using svn.) > > > > I got the sources from svn the same why I have always been getting > > the sources (the whole process of "get sources, build, deploy, > > update runtime" is automated in scripts). > > The symbol is defined in mingw in the file '/include/commctrl.h' through > the file '/include/pshpack1.h'. The relevant part in mingw's version of > commctrl.h (starting at line 2368) is: > ----8<---- > ... > typedef struct tagNMTTDISPINFOA { > NMHDR hdr; > LPSTR lpszText; > char szText[80]; > HINSTANCE hinst; > UINT uFlags; > #if (_WIN32_IE >= 0x0300) > LPARAM lParam; > #endif > } NMTTDISPINFOA, *LPNMTTDISPINFOA; > #define TOOLTIPTEXTA NMTTDISPINFOA > #define LPTOOLTIPTEXTA LPNMTTDISPINFOA > ... > ----8<---- > > So the only chance I had to detect if tagNMTTDISPINFOA is defined alredy > was to test one of the TOOLTIP macros. I know this is not the most > beautyful solution but I just wanted to show the problem and provide one > possible solution. > > I'll try to compile the FTP-sources now and see if the problem still > exists there -- report will follow.
Pity we can't check for typedefs with the preprocessor. It indeed looks like checking for LPTOOLTIPTEXT not being defined is the best solution, although it looks weird. Let's add a comment that explains it: /* Older compilers don't have LPNMTTDISPINFO[AW]. * MingW doesn't define LPNMTTDISPINFO but typedefs it. Therefore check * LPTOOLTIPTEXT which is defined to be the same. */ #if !defined(LPNMTTDISPINFO) && !defined(LPTOOLTIPTEXT) typedef struct tagNMTTDISPINFOA { NMHDR hdr; Hopefully that works for everybody. And without some magic dependency on MingW or gcc. -- hundred-and-one symptoms of being an internet addict: 91. It's Saturday afternoon in the middle of May and you are on computer. /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ download, build and distribute -- http://www.A-A-P.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///