Wrapping C++ in C.

Kevin Atkinson kevinatk@home.com
Fri Feb 4 12:11:00 GMT 2000


On Fri, 4 Feb 2000, Joe Buck wrote:

> You may object that you don't want to do this, but want some g++-specific
> hack that can call a munged version of the original function directly.  On
> some platforms, the original function, at assembler level, has a signature
> that looks like the wrapper function above (a pointer to the object is
> passed as the first argument and the original arguments follow).  

Yes that is what I want.  Why do you refuse to give me the answer I want.
Do you think because I am stupid enough not to know how to do this I
should not?

> But we
> can't promise that this will always be true on all g++ platforms and

I don't care if it works on all platforms but if it does work
I could get a potential speed increase.

> If you don't want the overhead of an extra function call, make Foo::bar
> inline.

This could lead to code bloat I want something more elegant.
> 
> (This is what the comp.std.c++ folks would tell you, I'm sure).
> 

Yes I am sure two and that is why I did not ask them as they would tell me
the obvious which I already knew.  I am not stupid.

Thank you for kindly telling me the extreme obvious.

BTW: could this "Extracting the function pointer from a bound pointer to
member function" have anything to do with what I am trying to get.

---
Kevin Atkinson
kevinatk@home.com
http://metalab.unc.edu/kevina/



More information about the Gcc mailing list