summaryrefslogtreecommitdiff
path: root/Tests/SBCS/SBCS.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/SBCS/SBCS.cxx')
-rw-r--r--Tests/SBCS/SBCS.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/Tests/SBCS/SBCS.cxx b/Tests/SBCS/SBCS.cxx
new file mode 100644
index 000000000..6ce2c9f25
--- /dev/null
+++ b/Tests/SBCS/SBCS.cxx
@@ -0,0 +1,22 @@
+// 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;
+}