Skip to content

Commit

Permalink
Stub out hybrid globalization
Browse files Browse the repository at this point in the history
We do not have the bandwidth to support it properly.

While ostensibly the upstream work could be reused, practically it is too tied to the Mono runtime internals.
  • Loading branch information
SingleAccretion committed Jul 7, 2023
1 parent 5736d36 commit d7fdc81
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#pragma warning disable IDE0060 // Remove unused parameter

using System;

internal static partial class Interop
{
internal static unsafe partial class JsGlobalization
{
internal static unsafe int CompareString(in string culture, char* str1, int str1Len, char* str2, int str2Len, global::System.Globalization.CompareOptions options, out int exceptionalResult, out object result) => throw new PlatformNotSupportedException();
internal static unsafe bool StartsWith(in string culture, char* str1, int str1Len, char* str2, int str2Len, global::System.Globalization.CompareOptions options, out int exceptionalResult, out object result) => throw new PlatformNotSupportedException();
internal static unsafe bool EndsWith(in string culture, char* str1, int str1Len, char* str2, int str2Len, global::System.Globalization.CompareOptions options, out int exceptionalResult, out object result) => throw new PlatformNotSupportedException();
internal static unsafe int IndexOf(in string culture, char* str1, int str1Len, char* str2, int str2Len, global::System.Globalization.CompareOptions options, bool fromBeginning, out int exceptionalResult, out object result) => throw new PlatformNotSupportedException();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#pragma warning disable IDE0060 // Remove unused parameter

using System;

internal static partial class Interop
{
internal static unsafe partial class JsGlobalization
{
internal static unsafe void ChangeCaseInvariant(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper, out int exceptionalResult, out object result) => throw new PlatformNotSupportedException();
internal static unsafe void ChangeCase(in string culture, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper, out int exceptionalResult, out object result) => throw new PlatformNotSupportedException();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1261,12 +1261,18 @@
<Compile Include="$(MSBuildThisFileDirectory)System\WeakReference.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\WeakReference.T.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\ComAwareWeakReference.cs" />
<Compile Include="$(CommonPath)Interop\Browser\Interop.CompareInfo.cs" Condition="'$(TargetsBrowser)' == 'true'">
<Compile Include="$(CommonPath)Interop\Browser\Interop.CompareInfo.cs" Condition="'$(TargetsBrowser)' == 'true' and '$(RuntimeFlavor)' == 'Mono'">
<Link>Common\Interop\Interop.CompareInfo.cs</Link>
</Compile>
<Compile Include="$(CommonPath)Interop\Browser\Interop.TextInfo.cs" Condition="'$(TargetsBrowser)' == 'true'">
<Compile Include="$(CommonPath)Interop\Browser\Interop.CompareInfo.NotSupported.cs" Condition="'$(TargetsBrowser)' == 'true' and '$(RuntimeFlavor)' != 'Mono'">
<Link>Common\Interop\Interop.CompareInfo.NotSupported.cs</Link>
</Compile>
<Compile Include="$(CommonPath)Interop\Browser\Interop.TextInfo.cs" Condition="'$(TargetsBrowser)' == 'true' and '$(RuntimeFlavor)' == 'Mono'">
<Link>Common\Interop\Interop.TextInfo.cs</Link>
</Compile>
<Compile Include="$(CommonPath)Interop\Browser\Interop.TextInfo.NotSupported.cs" Condition="'$(TargetsBrowser)' == 'true' and '$(RuntimeFlavor)' != 'Mono'">
<Link>Common\Interop\Interop.TextInfo.NotSupported.cs</Link>
</Compile>
<Compile Include="$(CommonPath)Interop\Interop.Calendar.cs">
<Link>Common\Interop\Interop.Calendar.cs</Link>
</Compile>
Expand Down

0 comments on commit d7fdc81

Please sign in to comment.