One may generally use __LINE__ and __FILE__ in C++ programs, with many toolchains, including GCC.
__LINE__ under GCC evaluates to an expression of type int;
__FILE__ evaluates to a char const[N] where N is the appropriate value.
- Does any major toolchain provide an equivalent to
__FILE__with typewchar const[N]? - If so, what is it?
You can make your own
WFILE:Tested with non-ASCII characters and filename
马克.cpp:Demo (running from cmd.exe and Chinese language support installed):