Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the clang equvivalent this declaration of a function pointer with __stdcall?

I have the following declaration of a function pointer:

extern long (__stdcall *FooPtr)(int* i);

That is, a function pointer that points to a function to be called with the stdcall calling convention (in VS terms).

How can I translate this declaration so that clang understands it?

like image 521
Tamás Szelei Avatar asked Oct 23 '25 05:10

Tamás Szelei


1 Answers

__attribute__((stdcall))

is the right answer: clang supports the following list of attributes which, in syntax, are very similar to gcc's ones.

e.g.

#if defined(__clang__) || defined(__GNUC__)
   #define stdCallConv __attribute__ ((stdcall))
#else
   ...
like image 65
Marco A. Avatar answered Oct 25 '25 20:10

Marco A.