From ab94f8720fa6e701f361c2b962cecf506c12cb2b Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Mon, 19 Mar 2018 17:14:32 +0100 Subject: [PATCH] Moves String.Comparison.cs to shared location --- src/mscorlib/System.Private.CoreLib.csproj | 1 - .../System.Private.CoreLib.Shared.projitems | 1 + .../System/String.Comparison.cs | 19 ------------------- src/mscorlib/src/System/String.CoreCLR.cs | 9 +++++++++ 4 files changed, 10 insertions(+), 20 deletions(-) rename src/mscorlib/{src => shared}/System/String.Comparison.cs (98%) diff --git a/src/mscorlib/System.Private.CoreLib.csproj b/src/mscorlib/System.Private.CoreLib.csproj index 79b36c356cf9..7fabe61d0c50 100644 --- a/src/mscorlib/System.Private.CoreLib.csproj +++ b/src/mscorlib/System.Private.CoreLib.csproj @@ -322,7 +322,6 @@ - diff --git a/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems b/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems index c18c944d44b0..7331b95f7862 100644 --- a/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems +++ b/src/mscorlib/shared/System.Private.CoreLib.Shared.projitems @@ -493,6 +493,7 @@ + diff --git a/src/mscorlib/src/System/String.Comparison.cs b/src/mscorlib/shared/System/String.Comparison.cs similarity index 98% rename from src/mscorlib/src/System/String.Comparison.cs rename to src/mscorlib/shared/System/String.Comparison.cs index b85af821b612..e9a0440c50e3 100644 --- a/src/mscorlib/src/System/String.Comparison.cs +++ b/src/mscorlib/shared/System/String.Comparison.cs @@ -21,10 +21,6 @@ namespace System { public partial class String { - // - //Native Static Methods - // - private static unsafe int CompareOrdinalIgnoreCaseHelper(String strA, String strB) { Debug.Assert(strA != null); @@ -61,21 +57,6 @@ private static unsafe int CompareOrdinalIgnoreCaseHelper(String strA, String str } } - // native call to COMString::CompareOrdinalEx - [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal static extern int CompareOrdinalHelper(String strA, int indexA, int countA, String strB, int indexB, int countB); - - //This will not work in case-insensitive mode for any character greater than 0x7F. - //We'll throw an ArgumentException. - [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal static extern unsafe int nativeCompareOrdinalIgnoreCaseWC(String strA, sbyte* strBBytes); - - // - // - // NATIVE INSTANCE METHODS - // - // - // // Search/Query methods // diff --git a/src/mscorlib/src/System/String.CoreCLR.cs b/src/mscorlib/src/System/String.CoreCLR.cs index a9688fe8a862..d805be3772c6 100644 --- a/src/mscorlib/src/System/String.CoreCLR.cs +++ b/src/mscorlib/src/System/String.CoreCLR.cs @@ -64,6 +64,15 @@ public extern int Length [MethodImplAttribute(MethodImplOptions.InternalCall)] internal extern bool IsAscii(); + // native call to COMString::CompareOrdinalEx + [MethodImplAttribute(MethodImplOptions.InternalCall)] + internal static extern int CompareOrdinalHelper(String strA, int indexA, int countA, String strB, int indexB, int countB); + + //This will not work in case-insensitive mode for any character greater than 0x7F. + //We'll throw an ArgumentException. + [MethodImplAttribute(MethodImplOptions.InternalCall)] + internal static extern unsafe int nativeCompareOrdinalIgnoreCaseWC(String strA, sbyte* strBBytes); + #if FEATURE_COMINTEROP // Set extra byte for odd-sized strings that came from interop as BSTR. [MethodImplAttribute(MethodImplOptions.InternalCall)]