Skip to content

Managed Renames for consistency #28819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Feb 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/coreclr/clr.featuredefines.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project>
<PropertyGroup>
<FeatureCoreCLR>true</FeatureCoreCLR>
<FeatureCollectibleALC>true</FeatureCollectibleALC>
<FeatureEventTrace>true</FeatureEventTrace>
<FeatureHardwareIntrinsics>true</FeatureHardwareIntrinsics>
Expand All @@ -14,7 +15,6 @@
</PropertyGroup>

<PropertyGroup Condition="'$(TargetsUnix)' == 'true'">
<FeaturePal>true</FeaturePal>
<FeatureXplatEventSource>true</FeatureXplatEventSource>

<FeatureArrayStubAsIL>true</FeatureArrayStubAsIL>
Expand Down Expand Up @@ -60,7 +60,6 @@
<DefineConstants Condition="'$(FeatureCominteropWinRTManagedActivation)' == 'true'">$(DefineConstants);FEATURE_COMINTEROP_WINRT_MANAGED_ACTIVATION</DefineConstants>
<DefineConstants Condition="'$(FeatureManagedEtw)' == 'true'">$(DefineConstants);FEATURE_MANAGED_ETW</DefineConstants>
<DefineConstants Condition="'$(FeatureManagedEtwChannels)' == 'true'">$(DefineConstants);FEATURE_MANAGED_ETW_CHANNELS</DefineConstants>
<DefineConstants Condition="'$(FeaturePal)' == 'true'">$(DefineConstants);FEATURE_PAL</DefineConstants>
<DefineConstants Condition="'$(FeaturePerfTracing)' == 'true'">$(DefineConstants);FEATURE_PERFTRACING</DefineConstants>
<DefineConstants Condition="'$(FeatureXplatEventSource)' == 'true'">$(DefineConstants);FEATURE_EVENTSOURCE_XPLAT</DefineConstants>
<DefineConstants Condition="'$(FeatureWin32Registry)' == 'true'">$(DefineConstants);FEATURE_WIN32_REGISTRY</DefineConstants>
Expand All @@ -73,8 +72,8 @@
<DefineConstants Condition="'$(ProfilingSupportedBuild)' == 'true'">$(DefineConstants);PROFILING_SUPPORTED</DefineConstants>
<DefineConstants Condition="'$(FeatureProfAttach)' == 'true'">$(DefineConstants);FEATURE_PROFAPI_ATTACH_DETACH</DefineConstants>

<DefineConstants Condition="'$(TargetsUnix)' == 'true'">$(DefineConstants);PLATFORM_UNIX</DefineConstants>
<DefineConstants Condition="'$(TargetsWindows)' == 'true'">$(DefineConstants);PLATFORM_WINDOWS</DefineConstants>
<DefineConstants Condition="'$(TargetsOSX)' == 'true'">$(DefineConstants);PLATFORM_OSX</DefineConstants>
<DefineConstants Condition="'$(TargetsUnix)' == 'true'">$(DefineConstants);TARGET_UNIX</DefineConstants>
<DefineConstants Condition="'$(TargetsWindows)' == 'true'">$(DefineConstants);TARGET_WINDOWS</DefineConstants>
<DefineConstants Condition="'$(TargetsOSX)' == 'true'">$(DefineConstants);TARGET_OSX</DefineConstants>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,19 @@
<PropertyGroup Condition="'$(Platform)' == 'x64'">
<PlatformTarget>x64</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<DefineConstants>BIT64;AMD64;$(DefineConstants)</DefineConstants>
<DefineConstants>TARGET_64BIT;TARGET_AMD64;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)' == 'x86'">
<PlatformTarget>x86</PlatformTarget>
<DefineConstants>BIT32;$(DefineConstants)</DefineConstants>
<DefineConstants>TARGET_32BIT;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)' == 'arm'">
<PlatformTarget>arm</PlatformTarget>
<DefineConstants>BIT32;ARM;$(DefineConstants)</DefineConstants>
<DefineConstants>TARGET_32BIT;TARGET_ARM;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)' == 'arm64'">
<PlatformTarget>AnyCPU</PlatformTarget>
<DefineConstants>BIT64;ARM64;$(DefineConstants)</DefineConstants>
<DefineConstants>TARGET_64BIT;TARGET_ARM64;$(DefineConstants)</DefineConstants>
</PropertyGroup>

<!-- Configuration specific properties -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private static string MarshalToString(IntPtr arg, string argName)
throw new ArgumentNullException(argName);
}

#if PLATFORM_WINDOWS
#if TARGET_WINDOWS
string? result = Marshal.PtrToStringUni(arg);
#else
string? result = Marshal.PtrToStringUTF8(arg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public ref struct ArgIterator
private IntPtr ArgPtr; // Pointer to remaining args.
private int RemainingArgs; // # of remaining args.

#if PLATFORM_WINDOWS // Native Varargs are not supported on Unix
#if TARGET_WINDOWS // Native Varargs are not supported on Unix
[MethodImpl(MethodImplOptions.InternalCall)]
private extern ArgIterator(IntPtr arglist);

Expand Down Expand Up @@ -178,6 +178,6 @@ public int GetRemainingCount()
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/coreclr/issues/9204
}
#endif // PLATFORM_WINDOWS
#endif // TARGET_WINDOWS
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using Internal.Runtime.CompilerServices;

#pragma warning disable SA1121 // explicitly using type aliases instead of built-in types
#if BIT64
#if TARGET_64BIT
using nuint = System.UInt64;
#else
using nuint = System.UInt32;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Internal.Runtime.CompilerServices;

#pragma warning disable SA1121 // explicitly using type aliases instead of built-in types
#if BIT64
#if TARGET_64BIT
using nuint = System.UInt64;
using nint = System.UInt64;
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Runtime.CompilerServices;

#pragma warning disable SA1121 // explicitly using type aliases instead of built-in types
#if BIT64
#if TARGET_64BIT
using nuint = System.UInt64;
#else
using nuint = System.UInt32;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,11 +509,8 @@ public override string Name
{
string s = GetFullyQualifiedName();

#if !FEATURE_PAL
int i = s.LastIndexOf('\\');
#else
int i = s.LastIndexOf(System.IO.Path.DirectorySeparatorChar);
#endif

if (i == -1)
return s;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using System.Runtime.Intrinsics.X86;

#pragma warning disable SA1121 // explicitly using type aliases instead of built-in types
#if BIT64
#if TARGET_64BIT
using nuint = System.UInt64;
#else
using nuint = System.UInt32;
Expand Down Expand Up @@ -53,7 +53,7 @@ private static int KeyToBucket(int[] table, nuint source, nuint target)
// then we use fibonacci hashing to reduce the value to desired size.

int hashShift = HashShift(table);
#if BIT64
#if TARGET_64BIT
ulong hash = (((ulong)source << 32) | ((ulong)source >> 32)) ^ (ulong)target;
return (int)((hash * 11400714819323198485ul) >> hashShift);
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Internal.Runtime.CompilerServices;

#pragma warning disable SA1121 // explicitly using type aliases instead of built-in types
#if BIT64
#if TARGET_64BIT
using nuint = System.UInt64;
#else
using nuint = System.UInt32;
Expand Down Expand Up @@ -125,11 +125,11 @@ public static int OffsetToStringData
// after the sync block, so don't count that.
// This property allows C#'s fixed statement to work on Strings.
// On 64 bit platforms, this should be 12 (8+4) and on 32 bit 8 (4+4).
#if BIT64
#if TARGET_64BIT
12;
#else // 32
8;
#endif // BIT64
#endif // TARGET_64BIT

}

Expand Down Expand Up @@ -285,7 +285,7 @@ internal class RawData
internal class RawArrayData
{
public uint Length; // Array._numComponents padded to IntPtr
#if BIT64
#if TARGET_64BIT
public uint Padding;
#endif
public byte Data;
Expand Down Expand Up @@ -323,7 +323,7 @@ internal unsafe struct MethodTable
#endif
;

#if BIT64
#if TARGET_64BIT
private const int InterfaceMapOffset = 0x38
#else
private const int InterfaceMapOffset = 0x24
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public static IntPtr AllocHGlobal(IntPtr cb)
// though I couldn't reproduce that. In either case, that means we should continue
// throwing an OOM instead of an ArgumentOutOfRangeException for "negative" amounts of memory.
UIntPtr numBytes;
#if BIT64
#if TARGET_64BIT
numBytes = new UIntPtr(unchecked((ulong)cb.ToInt64()));
#else // 32
numBytes = new UIntPtr(unchecked((uint)cb.ToInt32()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace System.Runtime.InteropServices.WindowsRuntime
{
#if BIT64
#if TARGET_64BIT
[StructLayout(LayoutKind.Explicit, Size = 24)]
#else
[StructLayout(LayoutKind.Explicit, Size = 20)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ private static string[] SplitPathsList(string? pathsList)
}
}

#if PLATFORM_WINDOWS
#if TARGET_WINDOWS
private const CharSet HostpolicyCharSet = CharSet.Unicode;
#else
private const CharSet HostpolicyCharSet = CharSet.Ansi;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ internal unsafe Assembly InternalLoad(ReadOnlySpan<byte> arrAssembly, ReadOnlySp
return loadedAssembly!;
}

#if !FEATURE_PAL
#if TARGET_WINDOWS
[DllImport(RuntimeHelpers.QCall, CharSet = CharSet.Unicode)]
private static extern IntPtr LoadFromInMemoryModuleInternal(IntPtr ptrNativeAssemblyLoadContext, IntPtr hModule, ObjectHandleOnStack retAssembly);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ internal static unsafe void ConvertFixedToNative(int flags, string strManaged, I

fixed (char* pwzChar = strManaged)
{
#if PLATFORM_WINDOWS
#if TARGET_WINDOWS
cbWritten = Interop.Kernel32.WideCharToMultiByte(
Interop.Kernel32.CP_ACP,
bestFit ? 0 : Interop.Kernel32.WC_NO_BEST_FIT_CHARS,
Expand Down Expand Up @@ -1565,7 +1565,7 @@ internal struct NativeVariant
// but on ARM it will allow us to correctly determine the layout of native argument lists containing
// VARIANTs). Note that the field names here don't matter: none of the code refers to these fields,
// the structure just exists to provide size information to the IL marshaler.
#if BIT64
#if TARGET_64BIT
private IntPtr data1;
private IntPtr data2;
#else
Expand Down Expand Up @@ -1857,10 +1857,10 @@ internal static void CheckStringLength(uint length)
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern IntPtr GetStubContext();

#if BIT64
#if TARGET_64BIT
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern IntPtr GetStubContextAddr();
#endif // BIT64
#endif // TARGET_64BIT

#if FEATURE_ARRAYSTUB_AS_IL
[MethodImpl(MethodImplOptions.InternalCall)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ internal unsafe void ReplaceBufferAnsiInternal(sbyte* newBuffer, int newLength)
// Both MultiByteToWideChar and the UTF8Encoding instance used on Unix-like
// platforms default to replacing invalid characters with the Unicode replacement
// character U+FFFD.
#if PLATFORM_WINDOWS
#if TARGET_WINDOWS
convertedChars = Interop.Kernel32.MultiByteToWideChar(
Interop.Kernel32.CP_ACP,
Interop.Kernel32.MB_PRECOMPOSED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#pragma warning disable 0809 //warning CS0809: Obsolete member 'Utf8Span.Equals(object)' overrides non-obsolete member 'object.Equals(object)'

#pragma warning disable SA1121 // explicitly using type aliases instead of built-in types
#if BIT64
#if TARGET_64BIT
using nint = System.Int64;
using nuint = System.UInt64;
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static ReadOnlySpan<byte> AsBytes(this Utf8String? text, int start, int l
return default;
}

#if BIT64
#if TARGET_64BIT
// See comment in Span<T>.Slice for how this works.
if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)text.Length)
ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.start);
Expand Down Expand Up @@ -164,7 +164,7 @@ public static Utf8Span AsSpan(this Utf8String? text, int start, int length)
return default;
}

#if BIT64
#if TARGET_64BIT
// See comment in Span<T>.Slice for how this works.
if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)text.Length)
ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.start);
Expand Down Expand Up @@ -256,7 +256,7 @@ public static ReadOnlyMemory<Char8> AsMemory(this Utf8String? text, int start, i
return default;
}

#if BIT64
#if TARGET_64BIT
// See comment in Span<T>.Slice for how this works.
if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)text.Length)
ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.start);
Expand Down Expand Up @@ -358,7 +358,7 @@ public static ReadOnlyMemory<byte> AsMemoryBytes(this Utf8String? text, int star
return default;
}

#if BIT64
#if TARGET_64BIT
// See comment in Span<T>.Slice for how this works.
if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)text.Length)
ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.start);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using System.Text;

#pragma warning disable SA1121 // explicitly using type aliases instead of built-in types
#if BIT64
#if TARGET_64BIT
using nint = System.Int64;
using nuint = System.UInt64;
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ private Utf8String TrimHelper(TrimType trimType)
[StackTraceHidden]
private void ValidateStartIndexAndLength(int startIndex, int length)
{
#if BIT64
#if TARGET_64BIT
// See comment in Span<T>.Slice for how this works.
if ((ulong)(uint)startIndex + (ulong)(uint)length > (ulong)(uint)this.Length)
ThrowHelper.ThrowArgumentOutOfRangeException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using Internal.Runtime.CompilerServices;

#pragma warning disable SA1121 // explicitly using type aliases instead of built-in types
#if BIT64
#if TARGET_64BIT
using nint = System.Int64;
using nuint = System.UInt64;
#else
Expand Down
10 changes: 5 additions & 5 deletions src/coreclr/src/ToolBox/SOS/DacTableGen/main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
using System.Collections;
using System.Collections.Generic;

#if !FEATURE_PAL
#if !TARGET_UNIX
using Dia;
using Dia.Util;
#endif // !FEATURE_PAL
#endif // !TARGET_UNIX
using System.Globalization;

/******************************************************************************
Expand All @@ -31,7 +31,7 @@ public abstract UInt32 GetVTableRVA(String symbolName,
String keyBaseName);
}

#if !FEATURE_PAL
#if !TARGET_UNIX
public class PdbSymbolProvider : SymbolProvider
{
public PdbSymbolProvider(String symbolFilename, String dllFilename)
Expand Down Expand Up @@ -149,7 +149,7 @@ public override UInt32 GetVTableRVA(String symbolName,
FileInfo fPDB = null;
DiaFile df = null;
}
#endif // !FEATURE_PAL
#endif // !TARGET_UNIX

public class Shell
{
Expand Down Expand Up @@ -295,7 +295,7 @@ public static int DoMain(String[] args)

if (pdbFile != null)
{
#if FEATURE_PAL
#if TARGET_UNIX
throw new InvalidOperationException("PDBs are only supported on Windows.");
#else
PdbSymbolProvider pdbSymProvider = new PdbSymbolProvider(pdbFile, dllFile);
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/src/tools/Common/JitInterface/CorInfoTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ public enum CorJitFlag : uint
CORJIT_FLAG_RELATIVE_CODE_RELOCS = 41, // JIT should generate PC-relative address computations instead of EE relocation records
CORJIT_FLAG_NO_INLINING = 42, // JIT should not inline any called method into this method

#region ARM64
#region TARGET_ARM64
CORJIT_FLAG_HAS_ARM64_AES = 43, // ID_AA64ISAR0_EL1.AES is 1 or better
CORJIT_FLAG_HAS_ARM64_ATOMICS = 44, // ID_AA64ISAR0_EL1.Atomic is 2 or better
CORJIT_FLAG_HAS_ARM64_CRC32 = 45, // ID_AA64ISAR0_EL1.CRC32 is 1 or better
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Test
private const string PathEnvSubdirectoryName = "Subdirectory";
private const string PathEnvFileName = "MovedNativeLib";

#if PLATFORM_WINDOWS
#if TARGET_WINDOWS
private const string RelativePath1 = @".\RelativeNative\..\DllImportPath_Relative";
private const string RelativePath3 = @"..\DllImportPathTest\DllImportPath_Relative";
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static int Main(string[] args)
Console.WriteLine("Method Auto.Marshal_Int_InOut: ExactSpelling = false. Verify CharSet.Auto behavior per-platform.");
int int9 = intManaged;
int intRet9 = Auto.Marshal_Int_InOut2(int9);
#if PLATFORM_WINDOWS
#if TARGET_WINDOWS
failures += Verify(intReturnUnicode, intManaged, intRet9, int9);
#else
failures += Verify(intReturnAnsi, intManaged, intRet9, int9);
Expand Down
Loading