如何使用_W64和__w64在VC ++中? [英] How do I use _W64 and __w64 in VC++?

查看:773
本文介绍了如何使用_W64和__w64在VC ++中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有这样的东西 __w64 在的Visual C ++ 9.我碰到它,而试图口我的本地C ++的DLL到64位。特别是在 crtdefs.h 有这个漂亮的片断:

There's such thing as __w64 in Visual C++ 9. I came across it while trying to port my native C++ DLL to 64 bit. In particular in crtdefs.h there's this nice snippet:

#if !defined(_W64)
#if !defined(__midl) && (defined(_X86_) || defined (_M_IX86)) && _MSC_VER >= 1300
#define _W64 __w64
#else
#define _W64
#endif
#endif

这要是我得到它的权利意味着,对于64位_W64被定义为一个空字符串,并没有任何影响,但对于32位被定义为 __ W64

我试图定义_W64是一个空字符串,进而和至少两个时间项目在64位配置编译罚款。 __ W64

I tried defining _W64 to be an empty string and __w64 in turn and at least both time the project compiles fine in 64-bit configuration.

这表示无论 _W64 __ W64 看起来毫无用处。我怎么打算用他们,我应该如何界定 _W64 64位的项目?

That said both _W64 and __w64 look useless. How am I intended to use them and how should I define _W64 in 64-bit projects?

推荐答案

答案是,你不知道。这是由32位编译器使用的编译器的功能。最初的想法是,微软希望prepare程序员为即将到来的32> 64位过渡。因此,在32位编译器获得了一定的标签类型定义为__w64的能力。微软随后用这种能力来标记类型定义,将在Win64的改变。

The answer is, you don't. It's a compiler feature for use by the 32 bits compiler. The original idea was that Microsoft wanted to prepare programmers for the upcoming 32->64 bits transition. Therefore, the 32 bits compiler gained the ability to label certain typedefs as __w64. Microsoft then used that ability to label typedefs that would change in Win64.

这篇关于如何使用_W64和__w64在VC ++中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆