简体   繁体   English

编译器指令WIN32和CPUX86,WIN64和CPUX64在Delphi中是否可以互换?

[英]Is compiler directive WIN32 and CPUX86, WIN64 and CPUX64 interchangeable in Delphi?

Is compiler directive WIN32 and CPUX86, WIN64 and CPUX64 interchangeable in Delphi? 编译器指令WIN32和CPUX86,WIN64和CPUX64在Delphi中是否可以互换?

If yes, Which one is preferred? 如果是,哪一个更受欢迎? If no, why? 如果不是,为什么?

Whether or not they are interchangeable depends on platforms you are developing for. 它们是否可互换取决于您正在开发的平台。

Generally, if you are doing only Windows development then they are interchangeable, otherwise not. 通常,如果您只进行Windows开发,那么它们是可互换的,否则不可互换。

WIN32 is defined only for Windows 32bit platform, and WIN64 is defined only for Windows 64bit platform. WIN32仅针对Windows 32位平台定义,而WIN64仅针对Windows 64位平台定义。

However, CPUX86 is defined for several platforms: Windows 32bit, OSX 32bit, and iOS 32bit simulator. 但是, CPUX86是针对多个平台定义的:Windows 32位,OSX 32位和iOS 32位模拟器。

Right now WIN64 and CPUX64 are only defined for Windows 64bit platform, so at the moment they are interchangeable, but that may change in the future. 目前WIN64CPUX64仅针对Windows 64位平台定义,因此目前它们可以互换,但未来可能会发生变化。

Which directive you should use depends on your code. 您应该使用哪个指令取决于您的代码。 Use directive that conveys proper meaning. 使用指示传达正确含义的指令。 If part of code is meant only to run on Windows 32bit platform then use WIN32 directive, if it is meant to run on any platform but under 32bit x86 processor then you should use CPUX86 . 如果部分代码仅用于在Windows 32位平台上运行,则使用WIN32指令,如果它要在任何平台上运行但在32位x86处理器下运行,则应使用CPUX86

Predefined Conditionals 预定义条件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM