diff options
author | Kyungwoo Lee <kyulee@microsoft.com> | 2015-12-10 16:18:25 -0800 |
---|---|---|
committer | Kyungwoo Lee <kyulee@microsoft.com> | 2015-12-11 08:19:16 -0800 |
commit | 1c472d376ac40130b78f32b62ab26dee1454c430 (patch) | |
tree | 961e0149f21b23da01d15a77e4c2cdca077431f6 /src/palrt | |
parent | cb25307b3022b67cf240ff534f05778845090921 (diff) | |
download | coreclr-1c472d376ac40130b78f32b62ab26dee1454c430.tar.gz coreclr-1c472d376ac40130b78f32b62ab26dee1454c430.tar.bz2 coreclr-1c472d376ac40130b78f32b62ab26dee1454c430.zip |
Enable ILASM for *nix
This enables ILASM for x-platforms.
1. Added a bunch of warning disable options mostly due to this prebuilt asmparse.cpp
2. Create a separte entry point "main" to pass WCHAR arguments.
3. PDB (CorSymWriter) part is disabled.
4. Converting/embedding resource file to binary is disabled.
5. jkotas kindly provided a code for IsTextUnicode which is unavailable on CoreCLR.
Diffstat (limited to 'src/palrt')
-rw-r--r-- | src/palrt/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/palrt/unicode.cpp | 28 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/palrt/CMakeLists.txt b/src/palrt/CMakeLists.txt index a66f148082..bc965db15a 100644 --- a/src/palrt/CMakeLists.txt +++ b/src/palrt/CMakeLists.txt @@ -11,6 +11,7 @@ set(PALRT_SOURCES memorystream.cpp path.cpp urlpars.cpp + unicode.cpp variant.cpp ) diff --git a/src/palrt/unicode.cpp b/src/palrt/unicode.cpp new file mode 100644 index 0000000000..2ea581586c --- /dev/null +++ b/src/palrt/unicode.cpp @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// +// + +#include "common.h" + +// This is a simplified implementation of IsTextUnicode. +// https://github.com/dotnet/coreclr/issues/2307 +BOOL IsTextUnicode(CONST VOID* lpv, int iSize, LPINT lpiResult) +{ + *lpiResult = 0; + + if (iSize < 2) return FALSE; + + BYTE * p = (BYTE *)lpv; + + // Check for Unicode BOM + if ((*p == 0xFF) && (*(p+1) == 0xFE)) + { + *lpiResult |= IS_TEXT_UNICODE_SIGNATURE; + return TRUE; + } + + return FALSE; +} + |