#elif defined without parentheses

别等时光非礼了梦想. 提交于 2019-12-07 04:19:04

问题


Using VS2005 with BLAH_BLAH defined the following preprocessor conditional is false:

#elif defined BLAH_BLAH

but if I change it to

#elif defined(BLAH_BLAH)

it is true.

Why do the parentheses make a difference here?


回答1:


It shouldn't make any difference, unless BLAH_BLAH is defined as something funny.




回答2:


The header file was created with a linux editor and added to the project with "Add Existing", after creating the file in the VS editor it evaluates to true. Must be a LF/CR issue?



来源:https://stackoverflow.com/questions/5223789/elif-defined-without-parentheses

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