Re: [AD] microscopic issues compiling 4.1.13 with latest MinGW packages |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Eric Botcazou:
> I'd rather not use unions when the problem is the cast to LPVOID*. I'm under
> the impression that declaring a temp object of type LPVOID, passing its
> address to the function and then assigning it to the original object should
> work. Am I mistaken?
Oh, you mean like this:
LPVOID temp = &directdraw;
/* ...then query the DirectDraw2 interface */
hr = IDirectDraw_QueryInterface(directdraw1, &IID_IDirectDraw2, &temp);
That works. I thought you meant there was a way to do it directly in the
function call, though.
>> Also, is it ok to always name the union members "first" and "second", with
>> "first" being the original type?
> Sure.
Ok. Maybe I've used std::pair one time too many, though. :) I guess alternative
names with more meaning could be:
union {
RECT *rect_ptr;
LPPOINT lppoint;
} dest_rect;
or
union {
RECT *orig_type;
LPPOINT cast_type;
} dest_rect;
Anyway, I'll try to make a patch.
Kind regards,
Daniel Schlyder
--
http://bitblaze.com/