Skip to content

Commit 8121b7a

Browse files
ViktorHoferRuihan-Yin
authored andcommitted
Replace NETCOREAPP compiler directive with NET (dotnet#101693)
* Replace NETCOREAPP compiler directive with NET Consistently use the `NET` preprocessor directive instead of a mix of both `NETCOREAPP` and `NET`. * Remaining NETCOREAPP usages * Update TestCaseCompilationMetadataProvider.cs * Update TestCaseCompilationMetadataProvider.cs
1 parent f274d29 commit 8121b7a

423 files changed

Lines changed: 853 additions & 853 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/ILInputCompiler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected virtual void SetupProcess (Process process, CompilerOptions options)
4545
private static string BuildArguments (CompilerOptions options)
4646
{
4747
var args = new StringBuilder ();
48-
#if NETCOREAPP
48+
#if NET
4949
args.Append (options.OutputPath.ExtensionWithDot == ".dll" ? "-dll" : "-exe");
5050
args.Append ($" -out:{options.OutputPath.InQuotes ()}");
5151
#else
@@ -58,7 +58,7 @@ private static string BuildArguments (CompilerOptions options)
5858

5959
protected virtual NPath LocateIlasm ()
6060
{
61-
#if NETCOREAPP
61+
#if NET
6262
var extension = RuntimeInformation.IsOSPlatform (OSPlatform.Windows) ? ".exe" : "";
6363

6464
var toolsDir = (string) AppContext.GetData ("Mono.Linker.Tests.ILToolsDir")!;

src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TestCaseCompilationMetadataProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public virtual IEnumerable<string> GetDefines ()
7777
yield return "WIN32";
7878

7979
if (Characteristics.HasFlag (TestRunCharacteristics.TargetingNetCore))
80-
yield return "NETCOREAPP";
80+
yield return "NET";
8181

8282
if (Characteristics.HasFlag (TestRunCharacteristics.SupportsDefaultInterfaceMethods))
8383
yield return "SUPPORTS_DEFAULT_INTERFACE_METHODS";

src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TestCaseCompiler.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
using System.Text;
1010
using Mono.Linker.Tests.Extensions;
1111
using Xunit;
12-
#if NETCOREAPP
12+
#if NET
1313
using System.Runtime.InteropServices;
1414
using Microsoft.CodeAnalysis;
1515
using Microsoft.CodeAnalysis.Emit;
@@ -190,7 +190,7 @@ protected static NPath MakeSupportingAssemblyReferencePathAbsolute (NPath output
190190
if (Path.IsPathRooted (referenceFileName))
191191
return referenceFileName.ToNPath ();
192192

193-
#if NETCOREAPP
193+
#if NET
194194
if (referenceFileName.StartsWith ("System.", StringComparison.Ordinal) ||
195195
referenceFileName.StartsWith ("Mono.", StringComparison.Ordinal) ||
196196
referenceFileName.StartsWith ("Microsoft.", StringComparison.Ordinal) ||
@@ -224,14 +224,14 @@ protected NPath CompileAssembly (CompilerOptions options)
224224

225225
protected virtual NPath CompileCSharpAssemblyWithDefaultCompiler (CompilerOptions options)
226226
{
227-
#if NETCOREAPP
227+
#if NET
228228
return CompileCSharpAssemblyWithRoslyn (options);
229229
#else
230230
return CompileCSharpAssemblyWithCsc (options);
231231
#endif
232232
}
233233

234-
#if NETCOREAPP
234+
#if NET
235235
protected virtual NPath CompileCSharpAssemblyWithRoslyn (CompilerOptions options)
236236
{
237237
var languageVersion = LanguageVersion.Default;
@@ -331,7 +331,7 @@ protected virtual NPath CompileCSharpAssemblyWithRoslyn (CompilerOptions options
331331

332332
protected virtual NPath CompileCSharpAssemblyWithCsc (CompilerOptions options)
333333
{
334-
#if NETCOREAPP
334+
#if NET
335335
return CompileCSharpAssemblyWithRoslyn (options);
336336
#else
337337
return CompileCSharpAssemblyWithExternalCompiler (LocateCscExecutable (), options, "/shared ");

src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TrimmingArgumentBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public virtual void ProcessOptions (TestCaseLinkerOptions options)
217217

218218
IgnoreLinkAttributes (options.IgnoreLinkAttributes);
219219

220-
#if !NETCOREAPP
220+
#if !NET
221221
if (!string.IsNullOrEmpty (options.Il8n))
222222
AddIl8n (options.Il8n);
223223
#endif

src/libraries/Common/src/Extensions/ChangeCallbackRegistrar.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ internal static class ChangeCallbackRegistrar
2121
/// <returns>The <see cref="CancellationToken"/> registration.</returns>
2222
internal static IDisposable UnsafeRegisterChangeCallback<T>(Action<object?> callback, object? state, CancellationToken token, Action<T> onFailure, T onFailureState)
2323
{
24-
#if NETCOREAPP || NETSTANDARD2_1
24+
#if NET || NETSTANDARD2_1
2525
try
2626
{
2727
return token.UnsafeRegister(callback, state);

src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Properties.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ internal static unsafe ErrorCode NCryptGetIntProperty(SafeNCryptHandle hObject,
5656
{
5757
fixed (int* pResult = &result)
5858
{
59-
#if NETSTANDARD || NETCOREAPP
59+
#if NETSTANDARD || NET
6060
Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
6161
#endif
6262

src/libraries/Common/src/System/HashCodeRandomization.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal static class HashCodeRandomization
1616
{
1717
public static int GetRandomizedOrdinalHashCode(this string value)
1818
{
19-
#if NETCOREAPP
19+
#if NET
2020
// In .NET Core, string hash codes are already randomized.
2121

2222
return value.GetHashCode();

src/libraries/Common/src/System/Reflection/AssemblyNameFormatter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ private static void AppendQuoted(this ref ValueStringBuilder vsb, string s)
129129
vsb.Append(quoteChar);
130130
}
131131

132-
#if !NETCOREAPP
132+
#if !NET
133133
private static void AppendSpanFormattable(this ref ValueStringBuilder vsb, ushort value)
134134
{
135135
vsb.Append(value.ToString());

src/libraries/Common/src/System/Resources/ResourceWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ private static ResourceTypeCode FindTypeCode(object? value, List<string> types)
488488
if (typeName.StartsWith("ResourceTypeCode.", StringComparison.Ordinal))
489489
{
490490
typeName = typeName.Substring(17); // Remove through '.'
491-
#if NETCOREAPP
491+
#if NET
492492
ResourceTypeCode typeCode = Enum.Parse<ResourceTypeCode>(typeName);
493493
#else
494494
ResourceTypeCode typeCode = (ResourceTypeCode)Enum.Parse(typeof(ResourceTypeCode), typeName);

src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs12/PfxAsn.manual.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ internal bool VerifyMac(
6363
throw new CryptographicException(SR.Cryptography_Der_Invalid_Encoding);
6464
}
6565

66-
#if NETCOREAPP
66+
#if NET
6767
Debug.Assert(expectedOutputSize <= 64); // SHA512 is the largest digest size we know about
6868
Span<byte> derived = stackalloc byte[expectedOutputSize];
6969
#else

0 commit comments

Comments
 (0)