Skip to content

Commit e9e6de8

Browse files
committed
Fix Windows build.
1 parent fbe1658 commit e9e6de8

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

src/MsgPack/Serialization/MessagePackSerializer.Factories.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@
2525
#define UNITY
2626
#endif
2727

28-
#if !UNITY && !SILVERLIGHT && !NETSTANDARD1_1
28+
#if !UNITY && !SILVERLIGHT && !NETSTANDARD1_1 && !WINDOWS_PHONE && !WINDOWS_UWP
2929
#define FEATURE_EMIT
30-
#endif // !UNITY && !SILVERLIGHT && !NETSTANDARD1_1
30+
#endif // !UNITY && !SILVERLIGHT && !NETSTANDARD1_1 && !WINDOWS_PHONE && !WINDOWS_UWP
3131

3232
using System;
3333
using System.IO;
3434
using System.Globalization;
35-
#if UNITY
35+
#if UNITY || WINDOWS_PHONE || WINDOWS_UWP
3636
using System.Linq;
3737
using System.Reflection;
38-
#endif // UNITY
38+
#endif // UNITY || WINDOWS_PHONE || WINDOWS_UWP
3939
using System.Runtime.Serialization;
4040

4141
using MsgPack.Serialization.DefaultSerializers;
@@ -215,15 +215,15 @@ internal static MessagePackSerializer<T> CreateInternal<T>( SerializationContext
215215
Contract.Ensures( Contract.Result<MessagePackSerializer<T>>() != null );
216216
#endif // DEBUG
217217

218-
#if DEBUG && !UNITY && !SILVERLIGHT && !NETSTANDARD1_1
218+
#if DEBUG && !UNITY && !SILVERLIGHT && !NETSTANDARD1_1 && !WINDOWS_UWP
219219
SerializerDebugging.TraceEmitEvent(
220220
"SerializationContext::CreateInternal<{0}>(@{1}, {2})",
221221
typeof( T ),
222222
context.GetHashCode(),
223223
schema == null ? "null" : schema.DebugString
224224
);
225225

226-
#endif // DEBUG && !UNITY && !SILVERLIGHT && !NETSTANDARD1_1
226+
#endif // DEBUG && !UNITY && !SILVERLIGHT && !NETSTANDARD1_1 && !WINDOWS_UWP
227227
Type concreteType = null;
228228
CollectionTraits collectionTraits =
229229
#if UNITY
@@ -360,7 +360,7 @@ public static MessagePackSerializer Create( Type targetType, SerializationContex
360360
Contract.Ensures( Contract.Result<MessagePackSerializer>() != null );
361361
#endif // DEBUG
362362

363-
#if UNITY
363+
#if UNITY || WINDOWS_PHONE || WINDOWS_UWP
364364
return CreateInternal( context, targetType, null );
365365
#else
366366
// MPS.Create should always return new instance, and creator delegate should be cached for performance.
@@ -411,7 +411,7 @@ public static MessagePackSerializer Create( Type targetType, SerializationContex
411411
);
412412
#endif // NETSTANDARD1_1 || NETSTANDARD1_3
413413
return factory( context );
414-
#endif // UNITY
414+
#endif // UNITY || WINDOWS_PHONE || WINDOWS_UWP
415415
}
416416

417417
/// <summary>
@@ -538,7 +538,7 @@ public static MessagePackSerializer Get( Type targetType, SerializationContext c
538538
return context.GetSerializer( targetType, providerParameter );
539539
}
540540

541-
#if UNITY
541+
#if UNITY || WINDOWS_PHONE || WINDOWS_UWP
542542
private static readonly System.Reflection.MethodInfo CreateInternal_2 =
543543
typeof( MessagePackSerializer ).GetRuntimeMethods()
544544
.Single( m =>
@@ -562,7 +562,7 @@ internal static MessagePackSerializer CreateInternal( SerializationContext conte
562562
as Func<SerializationContext, PolymorphismSchema, object> )( context, schema ) as MessagePackSerializer;
563563
#endif // UNITY
564564
}
565-
#endif // UNITY
565+
#endif // UNITY || WINDOWS_PHONE || WINDOWS_UWP
566566

567567
internal static MessagePackSerializer<T> CreateReflectionInternal<T>( SerializationContext context, Type concreteType, PolymorphismSchema schema )
568568
{

src/MsgPack/Serialization/SerializationContext.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
#if UNITY || NETSTANDARD1_1 || NETSTANDARD1_3
4040
using System.Linq;
4141
#endif // UNITY || NETSTANDARD1_1 || NETSTANDARD1_3
42-
#if UNITY
42+
#if UNITY || WINDOWS_PHONE || WINDOWS_UWP
4343
using System.Reflection;
44-
#endif // UNITY
44+
#endif // UNITY || WINDOWS_PHONE || WINDOWS_UWP
4545
using System.Threading;
4646

4747
using MsgPack.Serialization.DefaultSerializers;
@@ -61,10 +61,10 @@ public sealed partial class SerializationContext
6161
private static readonly object DefaultContextSyncRoot = new object();
6262
#endif // UNITY
6363

64-
#if UNITY
64+
#if UNITY || WINDOWS_PHONE || WINDOWS_UWP
6565
private static readonly MethodInfo GetSerializer1Method =
6666
typeof( SerializationContext ).GetRuntimeMethod( "GetSerializer", new[] { typeof( object ) } );
67-
#endif // UNITY
67+
#endif // UNITY || WINDOWS_PHONE || WINDOWS_UWP
6868

6969

7070
// Set SerializerRepository null because it requires SerializationContext, so re-init in constructor.
@@ -965,11 +965,11 @@ private static class SerializerGetter<T>
965965
Metadata._SerializationContext.GetSerializer1_Parameter_Method.MakeGenericMethod( typeof( T ) )
966966
) as Func<SerializationContext, object, MessagePackSerializer<T>>;
967967
#else
968-
#if !UNITY
968+
#if !UNITY && !WINDOWS_PHONE && !WINDOWS_UWP
969969
Metadata._SerializationContext.GetSerializer1_Parameter_Method
970-
#else
970+
#else // !UNITY && !WINDOWS_PHONE && !WINDOWS_UWP
971971
GetSerializer1Method
972-
#endif // !UNITY
972+
#endif // !UNITY && !WINDOWS_PHONE && !WINDOWS_UWP
973973
.MakeGenericMethod( typeof( T ) ).CreateDelegate(
974974
typeof( Func<SerializationContext, object, MessagePackSerializer<T>> )
975975
) as Func<SerializationContext, object, MessagePackSerializer<T>>;

src/MsgPack/Serialization/SerializerDebugging.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public static bool AvoidsGenericSerializer
107107
}
108108
#endif // DEBUG
109109

110-
#if !UNITY && !SILVERLIGHT && !NETSTANDARD1_1
110+
#if !UNITY && !SILVERLIGHT && !NETSTANDARD1_1 && !WINDOWS_UWP
111111
#if DEBUG
112112
[ThreadStatic]
113113
private static StringWriter _ilTraceWriter;
@@ -160,7 +160,7 @@ public static void TraceEmitEvent( string format, params object[] args )
160160
Tracer.Emit.TraceEvent( Tracer.EventType.DefineType, Tracer.EventId.DefineType, format, args );
161161
}
162162
#endif // DEBUG
163-
#endif // !UNITY && !SILVERLIGHT && !NETSTANDARD1_1
163+
#endif // !UNITY && !SILVERLIGHT && !NETSTANDARD1_1 && !WINDOWS_UWP
164164

165165
/// <summary>
166166
/// Traces the polymorphic schema event.
@@ -172,20 +172,20 @@ public static void TraceEmitEvent( string format, params object[] args )
172172
public static void TracePolimorphicSchemaEvent( string format, MemberInfo memberInfo, PolymorphismSchema schema )
173173
{
174174
#if DEBUG
175-
#if !UNITY && !SILVERLIGHT
175+
#if !UNITY && !SILVERLIGHT && !WINDOWS_UWP
176176
if ( !_traceEnabled )
177177
{
178178
return;
179179
}
180180

181181
Tracer.Emit.TraceEvent( Tracer.EventType.PolimorphicSchema, Tracer.EventId.PolimorphicSchema, format, memberInfo, schema == null ? "(null)" : schema.DebugString );
182-
#endif // !UNITY && !SILVERLIGHT
182+
#endif // !UNITY && !SILVERLIGHT && !WINDOWS_UWP
183183
#endif
184184
}
185185

186186
#if DEBUG
187187

188-
#if !UNITY && !SILVERLIGHT && !NETSTANDARD1_1
188+
#if !UNITY && !SILVERLIGHT && !NETSTANDARD1_1 && !WINDOWS_UWP
189189
/// <summary>
190190
/// Flushes the trace data.
191191
/// </summary>
@@ -372,7 +372,7 @@ public static void Reset()
372372
ResetDependentAssemblies();
373373
}
374374
#endif // !NETSTANDARD1_3
375-
#endif // !UNITY && !SILVERLIGHT && !NETSTANDARD1_1
375+
#endif // !UNITY && !SILVERLIGHT && !NETSTANDARD1_1 && !WINDOWS_UWP
376376

377377
#if NET35 || UNITY || SILVERLIGHT
378378
private static int _useLegacyNullMapEntryHandling;

src/MsgPack/Serialization/SerializerOptions.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
#endif // NETSTANDARD1_3 || NETSTANDARD2_0
3535
using System.Runtime.CompilerServices;
3636
using System.Threading;
37-
#if NETSTANDARD1_3 || NETSTANDARD2_0
37+
#if ( NETSTANDARD1_3 || NETSTANDARD2_0 ) && !WINDOWS_UWP
3838
using MsgPack.Serialization.EmittingSerializers;
39-
#endif // NETSTANDARD1_3 || NETSTANDARD2_0
39+
#endif // ( NETSTANDARD1_3 || NETSTANDARD2_0 ) && !WINDOWS_UWP
4040

4141
namespace MsgPack.Serialization
4242
{
@@ -148,7 +148,7 @@ public bool DisableRuntimeCodeGeneration
148148
[MethodImpl( MethodImplOptions.NoInlining )]
149149
private static bool DetermineCanEmit()
150150
{
151-
#if NETSTANDARD1_3 || NETSTANDARD2_0
151+
#if ( NETSTANDARD1_3 || NETSTANDARD2_0 ) && !WINDOWS_UWP
152152
try
153153
{
154154
return DetermineCanEmitCore();
@@ -165,15 +165,15 @@ private static bool DetermineCanEmit()
165165
#endif
166166
}
167167

168-
#if NETSTANDARD1_3 || NETSTANDARD2_0
168+
#if ( NETSTANDARD1_3 || NETSTANDARD2_0 ) && !WINDOWS_UWP
169169

170170
[MethodImpl( MethodImplOptions.NoInlining )]
171171
private static bool DetermineCanEmitCore()
172172
{
173173
return SerializationMethodGeneratorManager.Fast != null;
174174
}
175175

176-
#endif // NETSTANDARD1_3 || NETSTANDARD2_0
176+
#endif // ( NETSTANDARD1_3 || NETSTANDARD2_0 ) && !WINDOWS_UWP
177177

178178
internal bool CanRuntimeCodeGeneration
179179
{

0 commit comments

Comments
 (0)