Pelles C forum

Pelles C => Feature requests => Topic started by: henrin on September 09, 2022, 03:34:39 PM

Title: Langage interfacing
Post by: henrin on September 09, 2022, 03:34:39 PM
I dislike C++ but ... some nice functions are available in C++ only.
Calling them from C is a problem because of the parameter passing convention (th hidden first argument 'this').

I suppose it should not be very difficult to have a function attribute  __cppcall in addition to  __cdecl,  __fastcall,  __stdcall.

Is that a stupid suggestion?

Title: Re: Langage interfacing
Post by: frankie on September 09, 2022, 05:44:15 PM
Not clear what is the point.
C++ functions generally are __stdcall which first argument is a pointer to the class that is added transparently from compiler which knows the class the function belongs to.
In plain C the new function specifier what should be for? Without the whole C++ infrastructure what the compiler is supposed to do differently from the other specifiers?
Title: Re: Langage interfacing
Post by: John Z on September 10, 2022, 02:33:21 PM
I dislike C++ but ... some nice functions are available in C++ only.
Calling them from C is a problem because of the parameter passing convention (th hidden first argument 'this').

Maybe this forum thread will be helpful to you:
https://forum.pellesc.de/index.php?topic=10573.0

John Z