The Windows SDK defines the following type:
struct __declspec(novtable) GdiplusAbort { virtual HRESULT __stdcall Abort(void) = 0; };
I think that the following is a workable translation:
diff --git a/include/gdiplustypes.h b/include/gdiplustypes.h index 4f97432..444123f 100644 --- a/include/gdiplustypes.h +++ b/include/gdiplustypes.h @@ -55,6 +55,18 @@ typedef BOOL (CALLBACK * ImageAbort)(VOID *); typedef ImageAbort DrawImageAbort; typedef ImageAbort GetThumbnailImageAbort;
+struct GdiplusAbort; + +typedef struct gpabort_vtable +{ + HRESULT WINAPI (*Abort)(struct GdiplusAbort*); +} + +typedef struct GdiplusAbort +{ + struct gpabort_vtable *vtable_ptr; +} GdiplusAbort; + #ifdef __cplusplus } #endif
I don't think I can provide a proper C++ definition because the abi depends on the compiler.
Does this look correct?
On 19.11.2009 17:23, Vincent Povirk wrote:
The Windows SDK defines the following type:
struct __declspec(novtable) GdiplusAbort { virtual HRESULT __stdcall Abort(void) = 0; };
I don't think I can provide a proper C++ definition because the abi depends on the compiler.
Depends; with limitations this is possible. For cases like above - ie "interface" kind of structs with no members, only virtual methods and explicit calling convention specified - the resulting struct layout is the same between MSVC and g++ (at least on MinGW) and can be passed from binary code of one to another. If Linux g++ produces the same struct layout as it does on mingw it would be viable to keep the C++ version for, well, client sources written in C++.
Does this look correct?
You forgot __stdcall on 'Abort' member of gpabort_vtable.
-f.r.
On Thu, Nov 19, 2009 at 11:05 AM, Frank Richter frank.richter@gmail.com wrote:
Does this look correct?
You forgot __stdcall on 'Abort' member of gpabort_vtable.
WINAPI should be equivalent, but you're probably right. I should match the windows headers/documentation.