Re: [AD] MSVC bug in 4.1.18? |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> Hm, this doesn't seem to be fixed for me:
>
> Can it be that:
>
> #ifndef TITLEBARINFO
>
> Is true, wheather or not there exists a type with that name already?
If it's a typedef rather than a #define, as I guess it normally should be,
then yes. I should have paid more attention to that...
> I get the following error with current CVS and mingw:
>
> gcc -DALLEGRO_STATICLINK -DALLEGRO_SRC -DALLEGRO_LIB_BUILD -Wall
> -Wno-unused -m
> cpu=pentium -O2 -funroll-loops -ffast-math -fomit-frame-pointer -I.
> -I./include
> -o obj/mingw32/alleg_s/wwnd.o -c src/win/wwnd.c
> src/win/wwnd.c:92: conflicting types for `TITLEBARINFO'
> c:/MinGW/include/winuser.h:2720: previous declaration of `TITLEBARINFO'
> src/win/wwnd.c:92: conflicting types for `PTITLEBARINFO'
> c:/MinGW/include/winuser.h:2720: previous declaration of `PTITLEBARINFO'
> src/win/wwnd.c:92: conflicting types for `LPTITLEBARINFO'
> c:/MinGW/include/winuser.h:2720: previous declaration of
> `LPTITLEBARINFO'
> mingw32-make: *** [obj/mingw32/alleg_s/wwnd.o] Error 1
It should be ok to define our own struct that duplicates the TITLEBARINFO
struct defined by Microsoft and just pass a pointer to that to
GetTitleBarInfo if it exists. We may need to silence a warning generated by
the compiler, but the binary should continue to work as normal.
Alternatively, we could check if the headers we are using already define
that struct and not define it ourselves if they do. I'm not sure if Windows
headers provide such information (in a way similar to ALLEGRO_VERSION). I
wouldn't be surprised if not...
Evert