CMake/Tests/SBCS/SBCS.cxx
Aaron C. Meadows ba89e92ba6 Visual Studio: Allow setting Single Byte Character Set (#12189)
For Visual Studio using the Preprocessor Define _SBCS. This behavior
is similar to the way that _UNICODE and _MBCS work already.

Added tests to confirm this behavior.
2012-02-17 11:30:23 -05:00

23 lines
465 B
C++

// Test to verify that _SBCS being defined causes CharacterSet to be set to 0 (Single Byte Character Set)
int main ()
{
#ifdef _UNICODE
bool UnicodeSet=true;
#else
bool UnicodeSet=false;
#endif
#ifdef _MBCS
bool MBCSSet=true;
#else
bool MBCSSet=false;
#endif
// if neither _UNICODE nor _MBCS is set, CharacterSet must be set to SBCS.
bool SBCSSet=(!UnicodeSet && !MBCSSet);
// Reverse boolean to indicate error case correctly
return !SBCSSet;
}