WIN32和_WIN32在C ++中的定义有什么区别 [英] What's the difference between the WIN32 and _WIN32 defines in C++

查看:170
本文介绍了WIN32和_WIN32在C ++中的定义有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道WIN32显然是表示win32编译,但是需要_win32?

I know that WIN32 is obviously to denote win32 compilation but what is the need for _win32?

推荐答案

WIN32是一个名字你可以使用,甚至在自己的代码中定义,所以可能会与Microsoft的使用冲突。 _WIN32是为实现者(在本例中为MS)保留的名称,因为它以下划线和大写字母开头 - 不允许在您自己的代码中定义保留名称,因此不会有冲突。

WIN32 is a name that you could use and even define in your own code and so might clash with Microsoft's usage. _WIN32 is a name that is reserved for the implementor (tn this case MS) because it begins with an underscore and an uppercase letter - you are not allowed to define reserved names in your own code, so there can be no clash.

这篇关于WIN32和_WIN32在C ++中的定义有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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