gpt4 book ai didi

c++ - 默认情况下,c++ 成员函数是否使用 cdecl+fastcall 约定编译?

转载 作者:行者123 更新时间:2023-11-27 22:48:59 24 4
gpt4 key购买 nike

这2个约定在x86编译模式下一起使用?

对于 64 位编译,没有 cdecl + fastcall 对吗?只是 AMD 64 ABI 调用约定?如果是这样,如何在 64 位模式下在 stdcall 和 cdecl 之间延迟?

最佳答案

These 2 conventions are used together in x86 compilation mode?

没有。你从哪里得到这个想法的?每个调用约定都是不同的,任何给定的函数一次只能使用一个调用约定。不仅如此,fastcall 也没有标准化。不同的 32 位编译器以不同方式实现它(如果有的话),因此它不能用于可移植代码。 32 位中唯一的标准可移植调用约定是 cdeclstdcall

And for 64 bit compilation, there's no cdecl + fastcall right? Just AMD 64 ABI calling convention?

是的。 64 位中只有一种通用调用约定。代码中显式使用的 32 位调用约定将被忽略。

If so, how to defer between stdcall and cdecl in 64 bit mode?

你不知道。因为它们根本不存在。

关于c++ - 默认情况下,c++ 成员函数是否使用 cdecl+fastcall 约定编译?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39716041/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com