Re: calling functions generically

"Alen Ladavac" <[email protected]>
Newsgroups gmane.games.devel.general
Message-ID <[email protected]>
For a really robust and portable solution, perhaps you should use stubs?
Just use a simple parser to preprocess a header file with function headers
you want to call at runtime, and generate stub functions that take your
argument lists and call the real ones. If you can afford that preprocess
step (during compilation), you should have no problems handling any kind of
calling conventions on any system, because the compiler actually does is all
for you. A (very sketchy) description of this can be found in Game
Programming Gems 3, I believe. We've been using such a system for some time
now and it is very reliable.

Just my 0.02$,
Alen

> > Sometimes the complier does a "pop ecx" on return and
> > sometimes "mov dword ptr [ebp-0x8],eax" or a variant of that.
> > Can someone help me to understand how to robustly handle
> > this?



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Gamedevlists-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-general
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_id=557
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.