Skip to content

Commit 5ed1a30

Browse files
authored
Remove obsolete #if directives (#1915)
1 parent 677aeb2 commit 5ed1a30

Some content is hidden

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

59 files changed

+30
-3023
lines changed

Rx.NET/Source/facades/GlobalAssemblyVersion.cs

+3-13
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,14 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT License.
33
// See the LICENSE file in the project root for more information.
44

55

66
using System.Reflection;
77

88

9-
#if NETSTANDARD1_0 || WP8
10-
[assembly: AssemblyVersion("3.0.0.0")]
11-
#elif NETSTANDARD1_1 || WINDOWS8 || NET45 || NETCORE45
12-
[assembly: AssemblyVersion("3.0.1000.0")]
13-
#elif NETSTANDARD1_2 || WINDOWS81 || NET451 || NETCORE451 || WPA81
14-
[assembly: AssemblyVersion("3.0.2000.0")]
15-
#elif NETSTANDARD1_3 || NET46
16-
[assembly: AssemblyVersion("3.0.3000.0")]
17-
#elif NETSTANDARD1_4 || UAP10_0 || WINDOWS_UWP || NETCORE50 || NET461
9+
#if WINDOWS_UWP
1810
[assembly: AssemblyVersion("3.0.4000.0")]
19-
#elif NETSTANDARD1_5 || NET462
20-
[assembly: AssemblyVersion("3.0.5000.0")]
21-
#elif NETSTANDARD1_6 || NETCOREAPP1_0 || NET463 || NET472 || NETSTANDARD2_0
11+
#elif NET472 || NETSTANDARD2_0
2212
[assembly: AssemblyVersion("3.0.6000.0")]
2313
#else // this is here to prevent the build system from complaining. It should never be hit
2414
[assembly: AssemblyVersion("invalid")]

Rx.NET/Source/src/Microsoft.Reactive.Testing/Recorded.cs

-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ namespace Microsoft.Reactive.Testing
1414
/// </summary>
1515
/// <typeparam name="T">Type of the value.</typeparam>
1616
[DebuggerDisplay("{Value}@{Time}")]
17-
#if !NO_SERIALIZABLE
1817
[Serializable]
19-
#endif
2018
public readonly struct Recorded<T> : IEquatable<Recorded<T>>
2119
{
2220
// NB: Keep these fields for compat with serialized state.

Rx.NET/Source/src/Microsoft.Reactive.Testing/Subscription.cs

-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ namespace Microsoft.Reactive.Testing
1212
/// Records information about subscriptions to and unsubscriptions from observable sequences.
1313
/// </summary>
1414
[DebuggerDisplay("({Subscribe}, {Unsubscribe})")]
15-
#if !NO_SERIALIZABLE
1615
[Serializable]
17-
#endif
1816
public readonly struct Subscription : IEquatable<Subscription>
1917
{
2018
/// <summary>

Rx.NET/Source/src/System.Reactive.Observable.Aliases/ExcludeFromCodeCoverageAttribute.cs

-15
This file was deleted.

Rx.NET/Source/src/System.Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.Windows.cs

-84
This file was deleted.

Rx.NET/Source/src/System.Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.cs

-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT License.
33
// See the LICENSE file in the project root for more information.
44

5-
#if !NO_THREAD
65
using System.Reactive.Disposables;
76
using System.Threading;
87

@@ -251,4 +250,3 @@ private void Loop()
251250
}
252251
}
253252
}
254-
#endif

Rx.NET/Source/src/System.Reactive/Concurrency/EventLoopScheduler.cs

-5
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,13 @@ public EventLoopScheduler()
8686
{
8787
}
8888

89-
#if !NO_THREAD
9089
/// <summary>
9190
/// Creates an object that schedules units of work on a designated thread, using the specified factory to control thread creation options.
9291
/// </summary>
9392
/// <param name="threadFactory">Factory function for thread creation.</param>
9493
/// <exception cref="ArgumentNullException"><paramref name="threadFactory"/> is <c>null</c>.</exception>
9594
public EventLoopScheduler(Func<ThreadStart, Thread> threadFactory)
9695
{
97-
#else
98-
internal EventLoopScheduler(Func<ThreadStart, Thread> threadFactory)
99-
{
100-
#endif
10196
_threadFactory = threadFactory ?? throw new ArgumentNullException(nameof(threadFactory));
10297
_stopwatch = ConcurrencyAbstractionLayer.Current.StartStopwatch();
10398

Rx.NET/Source/src/System.Reactive/Concurrency/NewThreadScheduler.cs

-5
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,13 @@ public NewThreadScheduler()
2929
/// </summary>
3030
public static NewThreadScheduler Default => Instance.Value;
3131

32-
#if !NO_THREAD
3332
/// <summary>
3433
/// Creates an object that schedules each unit of work on a separate thread.
3534
/// </summary>
3635
/// <param name="threadFactory">Factory function for thread creation.</param>
3736
/// <exception cref="ArgumentNullException"><paramref name="threadFactory"/> is <c>null</c>.</exception>
3837
public NewThreadScheduler(Func<ThreadStart, Thread> threadFactory)
3938
{
40-
#else
41-
private NewThreadScheduler(Func<ThreadStart, Thread> threadFactory)
42-
{
43-
#endif
4439
_threadFactory = threadFactory ?? throw new ArgumentNullException(nameof(threadFactory));
4540
}
4641

Rx.NET/Source/src/System.Reactive/Concurrency/Thread.Stub.cs

-32
This file was deleted.

Rx.NET/Source/src/System.Reactive/Concurrency/ThreadPoolScheduler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT License.
33
// See the LICENSE file in the project root for more information.
44

5-
#if !LEGACY_WINRT && !NO_THREAD
5+
#if !LEGACY_WINRT
66
using System.Reactive.Disposables;
77
using System.Threading;
88

Rx.NET/Source/src/System.Reactive/ExcludeFromCodeCoverageAttribute.cs

-15
This file was deleted.

Rx.NET/Source/src/System.Reactive/Internal/CurrentPlatformEnlightenmentProvider.cs

-2
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,10 @@ public class CurrentPlatformEnlightenmentProvider : IPlatformEnlightenmentProvid
3434
return (T)(object)new ExceptionServicesImpl();
3535
}
3636

37-
#if !NO_THREAD || LEGACY_WINRT
3837
if (t == typeof(IConcurrencyAbstractionLayer))
3938
{
4039
return (T)(object)new ConcurrencyAbstractionLayerImpl();
4140
}
42-
#endif
4341

4442
if (t == typeof(IScheduler) && args != null)
4543
{

Rx.NET/Source/src/System.Reactive/Internal/HalfSerializer.cs

-2
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,8 @@ public static void ForwardOnNext<T>(ISink<T> sink, T item, ref int wip, ref Exce
4949
}
5050
}
5151
}
52-
#if !NO_TRACE
5352
else if (error == null)
5453
Trace.TraceWarning("OnNext called while another OnNext call was in progress on the same Observer.");
55-
#endif
5654
}
5755

5856
/// <summary>

Rx.NET/Source/src/System.Reactive/Internal/ReflectionUtils.cs

-4
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,6 @@ public static void GetEventMethods<TSender, TEventArgs>(Type targetType, object?
114114
}
115115
}
116116

117-
#if (CRIPPLED_REFLECTION && HAS_WINRT)
118-
public static MethodInfo GetMethod(this Type type, string name) => type.GetTypeInfo().GetDeclaredMethod(name);
119-
#endif
120-
121117
/// <summary>
122118
/// Determine whether a type represents a WinRT event registration token
123119
/// (https://learn.microsoft.com/en-us/uwp/api/windows.foundation.eventregistrationtoken).

Rx.NET/Source/src/System.Reactive/Internal/Stubs.cs

-6
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,9 @@ internal static class Stubs
1616
public static readonly Action<Exception> Throw = static ex => { ex.Throw(); };
1717
}
1818

19-
#if !NO_THREAD
2019
internal static class TimerStubs
2120
{
22-
#if NETSTANDARD1_3
23-
public static readonly System.Threading.Timer Never = new System.Threading.Timer(static _ => { }, null, System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite);
24-
#else
2521
public static readonly System.Threading.Timer Never = new System.Threading.Timer(static _ => { });
26-
#endif
2722
}
28-
#endif
2923
}
3024

0 commit comments

Comments
 (0)