用__stdcall声明函数指针的clang等价是什么?

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

本文关键字:clang 是什么 指针 stdcall 声明 函数      更新时间:2023-10-16

我有一个函数指针的如下声明:

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

也就是说,一个函数指针,指向一个用标准调用约定(在VS术语中)调用的函数。

我如何翻译这个声明以便clang理解它?

__attribute__((stdcall))

是正确的答案:clang支持以下属性列表,这些属性在语法上与gcc非常相似。

#if defined(__clang__) || defined(__GNUC__)
   #define stdCallConv __attribute__ ((stdcall))
#else
   ...