Re: Wrapping around stdcall

2005-07-07 Thread Maarten Lankhorst
To suppress warnings from my thiscall wrapped stuff, I came up with this solution, playing around a little with #define's: #ifdef __i386__ /* thiscall functions are i386-specific */ #ifdef __GNUC__ /* GCC erroneously warns that the newly wrapped function * isn't used, lets help it out of it's t

Re: Wrapping around stdcall

2005-07-06 Thread Frank Richter
On 06.07.2005 00:54, Maarten Lankhorst wrote: > But I still > wonder what I have to do to call a 'thiscall' function, since I probably > need it in ITextHost. Probably more assembly ;) 'Thiscall' expects 'this' in ecx, so perhaps create an stdcall wrapper function that contains some assembly to p

Re: Wrapping around stdcall

2005-07-05 Thread Felix Nawothnig
Maarten Lankhorst wrote: It looks evil, and those functions are not exactly what I want, because I need them in a vtable, which requires them to be something like HRESULT ... fnTextServ_blah(ITextServices *iface, args), I could recast those functions, but that is not exactly a 'clean' solution,

Re: Wrapping around stdcall

2005-07-05 Thread Maarten Lankhorst
Marcus Meissner schreef: On Tue, Jul 05, 2005 at 10:16:08PM +0200, Felix Nawothnig wrote: Marcus Meissner wrote: I wonder how I can do this cleaner (Meaning no compiler warnings without ugly hacks). Also I would like to know how to call a function like __thiscall_fnTextSrv_TxSendMessag

Re: Wrapping around stdcall

2005-07-05 Thread Felix Nawothnig
Marcus Meissner wrote: On second thought... What about abusing the "regparm(3)" attribute for this. It gets eax, edx, ecx, stackparam1, stackparam2, ... So what about using a construct like this (cloaked in some macros)? #define THISCALL0(name,this) __thiscall_#name(int unused_eax,int unused_e

Re: Wrapping around stdcall

2005-07-05 Thread Felix Nawothnig
Marcus Meissner wrote: Adding "thiscall" to gcc would perhaps help in the long run ... :/ Fun fun fun... Considering that gcc already knows regparm and we just need regparm(1) with ecx instead eax hacking in "thiscall" for C code shouldn't be too hard I think. But since this would be a very Win

Re: Wrapping around stdcall

2005-07-05 Thread Marcus Meissner
On Tue, Jul 05, 2005 at 10:16:08PM +0200, Felix Nawothnig wrote: > Marcus Meissner wrote: > >>I wonder how I can do this cleaner (Meaning no compiler warnings without > >>ugly hacks). Also I would like to know how to call a function like > >>__thiscall_fnTextSrv_TxSendMessage, because some methods

Re: Wrapping around stdcall

2005-07-05 Thread Marcus Meissner
On Tue, Jul 05, 2005 at 10:16:08PM +0200, Felix Nawothnig wrote: > Marcus Meissner wrote: > >>I wonder how I can do this cleaner (Meaning no compiler warnings without > >>ugly hacks). Also I would like to know how to call a function like > >>__thiscall_fnTextSrv_TxSendMessage, because some methods

Re: Wrapping around stdcall

2005-07-05 Thread Frank Richter
On 05.07.2005 21:30, Marcus Meissner wrote: >>2: initialisation from incompatible pointer type (in the vtable) > > > Hmm, unclear. You would need to change the extern void THISCALL(func)(); to > be the correct prototype. But otoh, the vtable types really are wrong (the methods just aren't stdcal

Re: Wrapping around stdcall

2005-07-05 Thread Felix Nawothnig
Marcus Meissner wrote: I wonder how I can do this cleaner (Meaning no compiler warnings without ugly hacks). Also I would like to know how to call a function like __thiscall_fnTextSrv_TxSendMessage, because some methods I need are implemented in windows' stdcall. And I would like to know wether i

Re: Wrapping around stdcall

2005-07-05 Thread Marcus Meissner
On Tue, Jul 05, 2005 at 07:42:23PM +0200, Maarten Lankhorst wrote: > I have been trying to get some work done on a class returned by > CreateTextServices, but the differences between windows' stdcall and > linux' are giving me a few headaches. right now I've done it pretty much > like this: > > /*

Wrapping around stdcall

2005-07-05 Thread Maarten Lankhorst
I have been trying to get some work done on a class returned by CreateTextServices, but the differences between windows' stdcall and linux' are giving me a few headaches. right now I've done it pretty much like this: /* These macros are taken from wine/dlls/msvcrt/cpp.c */ #ifdef __i386__ /* this