cuneiform team mailing list archive
-
cuneiform team
-
Mailing list archive
-
Message #00171
Re: Patch to build in MSVC++ 6 and pack mode in cuneiform-cli
I think move the problematic definitions in right place is a good fix.
2008/12/31 Jussi Pakkanen <jpakkane@xxxxxxxxx>
> On Tue, Dec 30, 2008 at 5:47 PM, Dmitry Polevoy
> <openocr.polevoy@xxxxxxxxx> wrote:
>
> > WORD is defined in windef.h and if use in cttypes.h
> > typedef uint16_t WORD;
> > MSVC++ 6 gives following
> >
> > Compiling...
> > ctcbase.cpp
> > D:\cuneiform\branches\cuneiform.0.0.xNix\kern\h\cttypes.h(213) : error
> > C2371: 'WORD' : redefinition; different basic types
> > C:\Program Files\Microsoft Visual
> Studio\VC98\INCLUDE\windef.h(144)
> > : see declaration of 'WORD'
> >
> > I don't know, why there is no such error in MSVC++ 9. In fact I make this
> > change only to build core under MSVC++ 6.
> > I agree this define would only be needed on non-windows platforms, but I
> > don't know that is needed in MinGW.
>
> I checked cttypes.h properly. It seems that it already does this, but
> some definitions (such as this one) are on the wrong side of an
> #ifdef. The format is something like this.
>
> #ifdef WIN32 /* Line 182 */
>
> #include <windows.h>
>
> #else /* 186 */
>
> /* Some definitions */
>
> #endif /* Line 199 */
>
> /* More definitions, including WORD */
>
> Thus the fix would be to move the problematic definitions upwards into
> the #else block starting at line 186 and ending at line 199. Those
> definitions that do not come from windows headers should stay right
> where they are.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~cuneiform<https://launchpad.net/%7Ecuneiform>
> Post to : cuneiform@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~cuneiform<https://launchpad.net/%7Ecuneiform>
> More help : https://help.launchpad.net/ListHelp
>
Follow ups
References