是否存在广泛使用的__FILE__宽字符变体? [英] Is there widely-available wide-character variant of `__FILE__`?
本文介绍了是否存在广泛使用的__FILE__宽字符变体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在C ++程序中,通常可以使用 __ LINE __
和 __ FILE __
,其中包含许多工具链,包括GCC 。
One may generally use __LINE__
and __FILE__
in C++ programs, with many toolchains, including GCC.
< GCC中的code> __ LINE __ 的计算结果为 int
类型的表达式;
__FILE __
的计算结果为 char const [N]
,其中 N 是适当的值。
__LINE__
under GCC evaluates to an expression of type int
;
__FILE__
evaluates to a char const[N]
where N is the appropriate value.
- 是否有任何主要工具链提供与
wchar const [N]类型的
?__ FILE __
等效的功能? - 如果是这样,
- Does any major toolchain provide an equivalent to
__FILE__
with typewchar const[N]
? - If so, what is it?
推荐答案
您可以创建自己的 WFILE
:
#define WIDE2(x) L##x
#define WIDE1(x) WIDE2(x)
#define WFILE WIDE1(__FILE__)
这篇关于是否存在广泛使用的__FILE__宽字符变体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文