开发者

Visual C++ 10 lowercases the __FILE__ macro

开发者 https://www.devze.com 2023-01-30 01:43 出处:网络
The __F开发者_如何学运维ILE__ preprocessor macro in Visual C++ 10 expands to the name of the source module, but in lowercase, e.g.

The __F开发者_如何学运维ILE__ 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消