https://github.com/Kitware/CMake
Raw File
Tip revision: f7cf69e34a1607e8ea2b6d10fef6a6058377c24e authored by Brad King on 27 July 2021, 13:29:13 UTC
CMake 3.21.1
Tip revision: f7cf69e
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