Euphoria
Ticket #581:
Extra Parameter in stdcall and cdecl call_back() pointers
-
Reported by
eumario
Dec 31, 2010
I know that this can be done, as I've got proven code that works in pre 4.0 releases, that allows user data to be stored with the call stack of a call_back pointer, which can be fetched to determine an object in which a method is being called on. This can be used in multiple setups, including Object Oriented programming. I think this should be a part of 4.1 release, native to the backend.
Details
1. Comment by jimcbrown
Dec 31, 2010
This can only be done when using cdecl. stdcall does not support it.
Watcom has a special "trick", since they use cdecl internally but have to support stdcall. This trick means that this feature also works with stdcall (but only when on Watcom C), but it would be very difficult to emulate on other compilers.
MSVC is absurdly strict about this. MSVC and MinGW's stdcall are the only ones who would have the limitation however, there should be no problem adding this on Watcom or on the *nix platforms.
OS/X has its own alignment headaches, but it might be doable. I'm not sure.