You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Certain c libraries use the ((libcall)) attribute in gcc to create interface structs for functions. What it does is it passes the interface base as first argument transparently when calling the function. Like this:
Type: LanguageService
Describe the bug
Certain c libraries use the ((libcall)) attribute in gcc to create interface structs for functions. What it does is it passes the interface base as first argument transparently when calling the function. Like this:
IInterface->SomeFunciton (arg1, arg2, etc);
becomes
IInterface->SomeFunction(IInterface, arg1, arg2, etc);
when constructing the call.
This is not supported in IntelliSense with the current c/c++. It would be a nice-to-have feature when working with these libraries.
To Reproduce
Copy/paste this in vscode and save as test.c:
`#ifdef amigaos4
#ifndef APICALL
#define APICALL attribute((libcall))
#endif
struct IntuitionIFace
{
unsigned int APICALL (*Obtain)(struct IntuitionIFace *Self, const char *arg1, char arg2);
unsigned int APICALL (*Release)(struct IntuitionIFace *Self, char arg3, short arg4);
} iface;
int main() {
struct IntuitionIFace *IIntuition = &iface;
//this below is the call
IIntuition->Obtain("Hello world", 'b');
}
#endif`
It will give am error squiggle at the end of last call.
Expected behavior
No error squiggle. The above compiles and runs with no errors in ppc-amigaos-gcc.
Screenshots
Additional context
The text was updated successfully, but these errors were encountered: