Visual C++ 10 lowercases the __FILE__ macro

。_饼干妹妹 提交于 2020-01-11 08:53:26

问题


The __FILE__ preprocessor macro in Visual C++ 10 expands to the name of the source module, but in lowercase, e.g.

c:\path\to\my\file\somesource.cpp

when the file name is actually

SomeSource.cpp

Is it possible to change this behaviour?


回答1:


As suggested by Hans Passant, I asked the question on Microsoft Connect and got the following answer:

Thanks for noting this. This behavior has existed for a while, at least back to VS 2008. Changing the default behavior could potentially be a breaking change for other customers, so we would prefer to keep the current behavior. Since FOO.TXT is mostly the same as foo.txt for the file system, hopefully using __FILE__ with any comparison can just involve a case-insensitive compare for your application.



来源:https://stackoverflow.com/questions/4387629/visual-c-10-lowercases-the-file-macro

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