我应该在 64 位版本中同时定义 _WIN32 和 _WIN64 吗? [英] Should I define both _WIN32 and _WIN64 in 64bit build?

查看:28
本文介绍了我应该在 64 位版本中同时定义 _WIN32 和 _WIN64 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们从已经存在的 32 位项目中添加 64 位配置时,Visual Studio 默认复制 32 位配置.VS 甚至复制_WIN32
我所有的 64 位项目现在也定义了 _WIN32,尽管它们(64 位 PE)永远不能在 32 位 Windows 上运行.这对我来说很不舒服.

When we add a 64bit configuration from a 32bit project that has already existed, Visual Studio copies the 32bit configurations by default. VS even copies _WIN32
All my 64bit projects define also _WIN32 now, despite they(64bit PEs) never can run on 32bit Windows. It is very uncomfortable to me.

如果没有任何问题,我想删除 _WIN32.我不确定.
如果我删除 _WIN32 定义可以吗?

I'd like to remove the _WIN32 if it doesn't have any problem. I'm not sure about that.
Is it okay if I remove the _WIN32 definition?

推荐答案

_WIN32 并不代表您认为的那样.这意味着我正在使用 Windows API".32 后缀是在 Windows NT 3.1 时代重新添加的,以使其区别于 Windows 版本 3 中使用的 16 位 API.由于位问题,该术语已经失宠.您可以在 stackoverflow.com 上看到这一点,[win32] 标签会将您带到 [winapi].

_WIN32 doesn't mean what you think it does. It means "I am using the Windows API". The 32 postfix was added back in the days of Windows NT 3.1 to make it distinct from the 16-bit API that was used in Windows version 3. This term has fallen out of favor because of the bitness problem. You can see this at stackoverflow.com, the [win32] tag takes you to [winapi].

不要删除它,您正在使用 Windows API.

Don't remove it, you are using the Windows API.

这篇关于我应该在 64 位版本中同时定义 _WIN32 和 _WIN64 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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