Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经有一些程序打算用作用汇编编写的 C++ 方法(具有适当的调用约定和名称修饰)。但是,当我尝试使用它们时
class Foo { extern void foo(); }
我得到“类成员的无效存储类”。如何正确地在外部定义 C++ 方法?
一种解决方法是生成一个 thunk,定义简单地调用程序集版本的方法,使用内联程序集来支持 thiscall 约定。事实上,我已经有了生成这些的代码。但是,我真的很想让这种更直接的方法起作用。
只是离开外部。默认情况下,函数在外部可见。