https://github.com/Kitware/CMake
Raw File
Tip revision: bd580b7d568493a795a855c0710ba4ad88532485 authored by Brad King on 09 April 2020, 12:33:17 UTC
CMake 3.17.1
Tip revision: bd580b7
SBCS.cxx
// 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;
}
back to top