summaryrefslogtreecommitdiffstats
path: root/source/core/slang-string.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-09-29 13:43:08 -0700
committerGitHub <noreply@github.com>2017-09-29 13:43:08 -0700
commit8a0ebb9fa25fd44def17b03b3f8aa1a33ad77940 (patch)
tree3f855c1f8057e53763cb083c3b898effb559b80b /source/core/slang-string.cpp
parent74f2f47cb63b02638270beecd20acea1a0f5665e (diff)
Get tests running/passing under Linux (#194)
* Get tests running/passing under Linux - Fix up `dlopen` abstraction - Fix up some test cases to request hlsl (rather than default to dxbc) so they can run on non-Windows targets - Fix up test runner ignore tests that can't run on current platform (and not count those as failure) - Fix file handle leeak in process spawner absttraction - Get additional test-related applications building - More tweaks to Travis script; in theory deployment is set up now (yeah, right) * fixup * fixup: Travis environment variable syntax * fixup: Buffer->begin * fixup: actually run full tests on one config * fixup: add build status badge for Travis
Diffstat (limited to 'source/core/slang-string.cpp')
-rw-r--r--source/core/slang-string.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/source/core/slang-string.cpp b/source/core/slang-string.cpp
index 5a3d8e4f9..460a077b5 100644
--- a/source/core/slang-string.cpp
+++ b/source/core/slang-string.cpp
@@ -172,14 +172,26 @@ namespace Slang
else
{
List<char> buf;
- Slang::Encoding::UTF16->GetBytes(buf, *this);
+ switch(sizeof(wchar_t))
+ {
+ case 2:
+ Slang::Encoding::UTF16->GetBytes(buf, *this);
+ break;
+
+ case 4:
+ Slang::Encoding::UTF32->GetBytes(buf, *this);
+ break;
+
+ default:
+ break;
+ }
auto length = buf.Count() / sizeof(wchar_t);
if (outLength)
*outLength = length;
- buf.Add(0);
- buf.Add(0);
+ for(int ii = 0; ii < sizeof(wchar_t); ++ii)
+ buf.Add(0);
wchar_t* beginData = (wchar_t*)buf.Buffer();
wchar_t* endData = beginData + length;