不寻常的 C 函数声明

Unusual C function declaration

我目前正在使用旧的 C 库(90 年代初制作),以下函数声明让我感到困惑:

#define bland_dll
typedef unsigned short int usint;
typedef unsigned char uchar;

int bland_dll Read_Chan (usint channel);

bland_dll 函数名称和 return 类型之间的作用是什么?

谢谢你的灯!

它是一个定义空的宏,所以经过预处理后结果是:

int Read_Chan (usint channel);

我怀疑,它是早期声明 DLL linkage 类型时遗留下来的,例如 pascal 对 linker 具有特殊意义。另一个例子是 __cdecl.

为了完成编译器的特质link年龄机制:

  1. __stdcall
  2. __fastcall
  3. __cdecl

它们中的每一个都影响了 linker 在编译时管理名称修饰的方式,并且可能由于 link 的不同而导致与第三方 DLL 的 linking 冲突时间开关。

编辑:感谢 unwind 的更正。