divyang4481 / rcf-cpp

Automatically exported from code.google.com/p/rcf-cpp
0 stars 0 forks source link

Wrong #define-condition "UNICODE" for _T macro. #4

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Steps to reproduce compiler errors because of wrong use of the "_T"-macro:
1. Take the demo project and call the project-property window of the
Client-project.
2. Set "Configuration Properties/General/Character Set/" to "Not Set".
3. Under "Configuration Properties/C/C++/Command Line/Additional Options"
add "\D UNICODE".
4. Rebuild client project.

Then there will be several compiler errors in file sspifilter.hpp, for example:
" cannot convert from 'const char [1]' to 'const RCF::tstring &'", line 186

The macro "_T" is used to convert "" into a char or a wchar_t.
The typedef "tstring" is a std::string or a std::wstring.

With the define "UNICODE", typedef tstring is a std::wstring.
But without define "_UNICODE", _T"" is populated to "", not to L"" and
causes the compiler errors.

Issue occurred in Version 0.9d.

I think, a define UNICODE does not means that the define "_UNICODE" is
automatically there too.
UNICODE is a define for the windows-header (take the ...W variants of the
API Calls).
_UNICODE is a define for the C-Runtime.
See also: http://blogs.msdn.com/oldnewthing/archive/2004/02/12/71851.aspx 

Original issue reported on code.google.com by Hungerha...@googlemail.com on 5 Aug 2008 at 12:07

GoogleCodeExporter commented 9 years ago

Original comment by jarl.lin...@gmail.com on 12 Aug 2008 at 1:35

GoogleCodeExporter commented 9 years ago
Fixed in 1.0 .

Original comment by jarl.lin...@gmail.com on 22 Oct 2008 at 5:51

GoogleCodeExporter commented 9 years ago

Original comment by jarl.lin...@gmail.com on 28 May 2009 at 1:43