diff options
| author | Anders Leino <aleino@nvidia.com> | 2024-09-25 10:24:51 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-25 10:24:51 +0300 |
| commit | f5bf5ba5170058f9a9634438f7ff06f1a02e1da6 (patch) | |
| tree | f01e2aeb4c2336798fa43a44cf7532a52b2b4bc3 /source/slang/slang-workspace-version.cpp | |
| parent | cb1fc34c7dae3cb8642e150fcc189683c27859d4 (diff) | |
Enable emscripten builds to compile slang.dll to WebAssembly. (#5131)
* Compile fixes for Wasm
The issues are all are due to 'long' types being 32 bits on WASM.
- class members redeclared errors
- << with StringBuilder and unsigned long is ambiguous
This helps to address issue #5115.
* Use the host executable suffix for generators
Since the generators are run at build-time, we should not use CMAKE_EXECUTABLE_SUFFIX,
which is the suffix for the target platform.
Instead, define CMAKE_HOST_EXECUTABLE_SUFFIX as appropriate, and use that suffix instead.
This helps to address issue #5115.
* Add support for Wasm as a platform
This helps to address issue #5115.
* Add emscripten build
This closes #5115.
Diffstat (limited to 'source/slang/slang-workspace-version.cpp')
| -rw-r--r-- | source/slang/slang-workspace-version.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/slang/slang-workspace-version.cpp b/source/slang/slang-workspace-version.cpp index d85724328..f3ae6271a 100644 --- a/source/slang/slang-workspace-version.cpp +++ b/source/slang/slang-workspace-version.cpp @@ -457,7 +457,7 @@ ArrayView<Index> DocumentVersion::getUTF8Boundaries(Index line) } void DocumentVersion::oneBasedUTF8LocToZeroBasedUTF16Loc( - Index inLine, Index inCol, Index& outLine, Index& outCol) + Index inLine, Index inCol, int64_t& outLine, int64_t& outCol) { if (inLine <= 0) { @@ -472,12 +472,12 @@ void DocumentVersion::oneBasedUTF8LocToZeroBasedUTF16Loc( } void DocumentVersion::oneBasedUTF8LocToZeroBasedUTF16Loc( - Index inLine, Index inCol, int& outLine, int& outCol) + Index inLine, Index inCol, int32_t& outLine, int32_t& outCol) { - Index ioutLine, ioutCol; + int64_t ioutLine, ioutCol; oneBasedUTF8LocToZeroBasedUTF16Loc(inLine, inCol, ioutLine, ioutCol); - outLine = (int)ioutLine; - outCol = (int)ioutCol; + outLine = (int32_t)ioutLine; + outCol = (int32_t)ioutCol; } void DocumentVersion::zeroBasedUTF16LocToOneBasedUTF8Loc( |
