主题:请问__fastcall与_fastcall分别是什么,有什么区别?
youfeng555
[专家分:0] 发布于 2006-05-12 16:55:00
谢谢大家指教!
回复列表 (共3个回复)
沙发
christ115 [专家分:1580] 发布于 2006-05-16 13:23:00
这两个没任何区别,都是通过寄存器传递参数的函数调用方式。
板凳
lisypro [专家分:240] 发布于 2006-05-17 10:00:00
名称有什么区别么
3 楼
雪天飞剑 [专家分:0] 发布于 2006-05-20 10:45:00
Category
Modifiers, C++Builder keyword extensions
Syntax
return-value _fastcall function-name(parm-list)
return-value __fastcall function-name(parm-list)
Description
Use the __fastcall modifier to declare functions that expect parameters to be passed in registers. The first three parameters are passed (from left to right) in EAX, EDX, and ECX, if they fit in the register. The registers are not used if the parameter is a floating-point or struct type.
All form class member functions must use the __fastcall convention.
The compiler treats this calling convention as a new language specifier, along the lines of _cdecl and _pascal
Functions declared using _cdecl or _pascal cannot also have the _fastcall modifiers because they use the stack to pass parameters. Likewise, the __fastcall modifier cannot be used together with _export.
The compiler prefixes the __fastcall function name with an at-sign ("@"). This prefix applies to both unmangled C function names and to mangled C++ function names.
For Microsoft VC++ style __fastcall implementation, see __msfastcall and __msreturn.
Note: The __fastcall modifier is subject to name mangling. See the description of the -VC option.
我来回复