Workaround to get codes to work in MSVC++ 2010 due to “Type name is not allowed”

风格不统一 提交于 2019-12-06 16:20:24

The reason is that near and far are already #defined elsewhere as something else. This is typical if you have already included windows.h, which includes windef.h with following macros:

#define far
#define near
#if (!defined(_MAC)) && ((_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED))
#define pascal __stdcall
#else
#define pascal
#endif

Try changing names into something like plane_near and plane_far and it will work.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!