From 9a35f320b73c2a7885446bdf18abe9c1055e9523 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Thu, 30 Aug 2018 21:06:51 -0700 Subject: [PATCH] Fix build break in CoreRT/ProjectN Signed-off-by: dotnet-bot Commit migrated from https://github.com/dotnet/coreclr/commit/9ed18951643bc05060b377bf006f2530cb857bdb --- .../src/System/Diagnostics/Tracing/EventSource.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs index 1013112..1f8c0b0 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs @@ -1785,7 +1785,12 @@ namespace System.Diagnostics.Tracing if (dataType.IsEnum()) { dataType = Enum.GetUnderlyingType(dataType); - if (Runtime.InteropServices.Marshal.SizeOf(dataType) < sizeof(int)) +#if ES_BUILD_PN + int dataTypeSize = (int)dataType.TypeHandle.ToEETypePtr().ValueTypeSize; +#else + int dataTypeSize = System.Runtime.InteropServices.Marshal.SizeOf(dataType); +#endif + if (dataTypeSize < sizeof(int)) dataType = typeof(int); goto Again; } -- 2.7.4