Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2015-12-29 10:38:42 +0300
committerJan Kotas <jkotas@microsoft.com>2015-12-29 10:38:42 +0300
commit84b4f44572da69e07325e2b09988c1727cefdbff (patch)
treeff468ecf68a3444e0b01ed2d1dc831661c77d5bb /src/Common
parenteeb6da51293765e229babd9eae4c18d5bc560635 (diff)
parent69985cebe4246f1667d96aae778d892298c20376 (diff)
Merge pull request #566 from jkotas/cleanup-workarounds
Cleanup and centralize workarounds
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/src/Interop/Unix/System.Private.CoreLib.Native/Interop.Environment.cs2
-rw-r--r--src/Common/src/Interop/Unix/System.Private.CoreLib.Native/Interop.StringHelper.cs26
2 files changed, 1 insertions, 27 deletions
diff --git a/src/Common/src/Interop/Unix/System.Private.CoreLib.Native/Interop.Environment.cs b/src/Common/src/Interop/Unix/System.Private.CoreLib.Native/Interop.Environment.cs
index b429c01c1..b47b4a236 100644
--- a/src/Common/src/Interop/Unix/System.Private.CoreLib.Native/Interop.Environment.cs
+++ b/src/Common/src/Interop/Unix/System.Private.CoreLib.Native/Interop.Environment.cs
@@ -10,6 +10,6 @@ internal static partial class Interop
internal unsafe partial class Sys
{
[DllImport(Interop.Libraries.SystemPrivateCoreLibNative)]
- internal static unsafe extern int GetEnvironmentVariable(byte* name, out IntPtr result);
+ internal static unsafe extern int GetEnvironmentVariable(string name, out IntPtr result);
}
}
diff --git a/src/Common/src/Interop/Unix/System.Private.CoreLib.Native/Interop.StringHelper.cs b/src/Common/src/Interop/Unix/System.Private.CoreLib.Native/Interop.StringHelper.cs
deleted file mode 100644
index a4109e78f..000000000
--- a/src/Common/src/Interop/Unix/System.Private.CoreLib.Native/Interop.StringHelper.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Text;
-
-internal static partial class Interop
-{
- internal unsafe partial class StringHelper
- {
- public static unsafe byte[] GetBytesFromUTF8string(string value)
- {
- int bytecount = Encoding.UTF8.GetByteCount(value);
-
- // GetByteCount does not account for the trailing zero that is needed
- // Add one to allocate the trailing zero for the string.
- // Note: The runtime will zero-initialize the buffer
- byte[] result = new byte[bytecount + 1];
- fixed (char* pValue = value)
- fixed (byte* pResult = result)
- Encoding.UTF8.GetBytes(pValue, value.Length, pResult, bytecount);
-
- return result;
- }
- }
-}