小记一下

c 基本不改:无 name mangling,函数名 == 符号名,仅受平台 ABI 影响(如 Windows 可能 _foo,Unix/Linux 通常 foo)

c++ 一定会改名:

c++ 如果需要混合编程 ISO_C_BINDING:

extern "C" void foo(int a);

fortran 程序:

比如:

module m
contains
  subroutine foo(a)
  end subroutine
end module

__m_MOD_foo

fortran 如果混合编程 ISO_C_BINDING:

subroutine foo(a) bind(C, name="foo")
  use iso_c_binding
  integer(c_int), value :: a
end subroutine