I
Immortal Nephi
I examine some websites to look for predefined macros. __FILE__,
__DATE__, and __TIME__ are reserved by C/C++ Compiler. If you try to
convert them to Unicode, they are not yet implemented or they are
undefined.
#define _WIDEN2( x ) L ## x
#define _WIDEN( x ) _WIDEN2( x )
#define __WFILE__ _WIDEN( __FILE__ )
#define __WDATE__ _WIDEN( __DATE__ )
#define __WTIME__ _WIDEN( __TIME__ )
You cannot define __WFILE__, __WDATE__, and __WTIME__ because they
might be reserved and added to C/C++ Compiler in the future.
I thought that you accept alternative solution.
const std::wstring WIDEN( const char* Text )
{
std::wostringstream woss;
woss << Text;
return woss.str();
}
int main()
{
std::wstring WFILE = WIDEN( __FILE__ );
std::wcout << "File: " << WFILE << std::endl;
return 0;
}
Please let me know what you are saying your opinion.
__DATE__, and __TIME__ are reserved by C/C++ Compiler. If you try to
convert them to Unicode, they are not yet implemented or they are
undefined.
#define _WIDEN2( x ) L ## x
#define _WIDEN( x ) _WIDEN2( x )
#define __WFILE__ _WIDEN( __FILE__ )
#define __WDATE__ _WIDEN( __DATE__ )
#define __WTIME__ _WIDEN( __TIME__ )
You cannot define __WFILE__, __WDATE__, and __WTIME__ because they
might be reserved and added to C/C++ Compiler in the future.
I thought that you accept alternative solution.
const std::wstring WIDEN( const char* Text )
{
std::wostringstream woss;
woss << Text;
return woss.str();
}
int main()
{
std::wstring WFILE = WIDEN( __FILE__ );
std::wcout << "File: " << WFILE << std::endl;
return 0;
}
Please let me know what you are saying your opinion.