Skip to content

Commit

Permalink
Cleanup ifdefs
Browse files Browse the repository at this point in the history
  • Loading branch information
tmat committed Mar 20, 2018
1 parent c77b145 commit a77e70a
Show file tree
Hide file tree
Showing 25 changed files with 35 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#if NET461
#if NET46
using System;
using System.Collections.Immutable;
using System.IO;
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenTupleTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21317,7 +21317,7 @@ public ValueTuple(T1 _1, T2 _2, T3 _3) { }
}

// https://github.com/dotnet/roslyn/issues/25141
#if NET461
#if NET46
[Fact]
public void ValueTupleBase_AssemblyUnification()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#if NET461
#if NET46

using System;
using System.Collections.Immutable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#if NET461
#if NET46

using System.Collections.Immutable;
using System.IO;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#if NET46 || NET461
#if NET46

using System;
using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Test/Emit/Emit/NoPiaEmbedTypes.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#if NET461
#if NET46

using Microsoft.Cci;
using Microsoft.CodeAnalysis.CSharp.Symbols;
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Test/Emit/PDB/PDBUsingTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#if NET461
#if NET46

using System.Collections.Immutable;
using System.IO;
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Test/Emit/PrivateProtected.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

#if NET461
#if NET46

using System.Collections.Immutable;
using Microsoft.CodeAnalysis.CSharp.Test.Utilities;
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/Shared/DesktopAnalyzerAssemblyLoader.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

#if NET46 || NET461
#if NET46

using System;
using System.Reflection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public async Task LeadingDirectives()
{
await TestInRegularAndScriptAsync(
@"
#define NET461
#define NET46
using System;
Expand All @@ -222,7 +222,7 @@ public class Class1
{
public static string GetText()
{
#if NET461
#if NET46
return ""Hello from "" + Environment.OSVersion;
#elif NETSTANDARD1_4
return ""Hello from .NET Standard"";
Expand All @@ -234,7 +234,7 @@ public static string GetText()
}
}",
@"
#define NET461
#define NET46
using System;
Expand All @@ -244,7 +244,7 @@ public class Class1
{
public static string GetText()
{
#if NET461
#if NET46
return ""Hello from "" + Environment.OSVersion;
#elif NETSTANDARD1_4
return ""Hello from .NET Standard"";
Expand Down
10 changes: 5 additions & 5 deletions src/Test/Utilities/Portable/Assert/UseCultureAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public UseCultureAttribute(string culture)
/// <param name="uiCulture">The name of the UI culture.</param>
public UseCultureAttribute(string culture, string uiCulture)
{
#if NET46 || NET461
#if NET46
_culture = new Lazy<CultureInfo>(() => new CultureInfo(culture, useUserOverride: false));
_uiCulture = new Lazy<CultureInfo>(() => new CultureInfo(uiCulture, useUserOverride: false));
#elif NETCOREAPP2_0
Expand Down Expand Up @@ -83,11 +83,11 @@ public override void Before(MethodInfo methodUnderTest)
_originalCulture = CultureInfo.CurrentCulture;
_originalUICulture = CultureInfo.CurrentUICulture;

#if NET46 || NET461 || NETCOREAPP2_0
#if NET46 || NETCOREAPP2_0
CultureInfo.CurrentCulture = Culture;
CultureInfo.CurrentUICulture = UICulture;

#if NET46 || NET461
#if NET46
CultureInfo.CurrentCulture.ClearCachedData();
CultureInfo.CurrentUICulture.ClearCachedData();
#endif
Expand All @@ -103,11 +103,11 @@ public override void Before(MethodInfo methodUnderTest)
/// <param name="methodUnderTest">The method under test</param>
public override void After(MethodInfo methodUnderTest)
{
#if NET46 || NET461 || NETCOREAPP2_0
#if NET46 || NETCOREAPP2_0
CultureInfo.CurrentCulture = _originalCulture;
CultureInfo.CurrentUICulture = _originalUICulture;

#if NET46 || NET461
#if NET46
CultureInfo.CurrentCulture.ClearCachedData();
CultureInfo.CurrentUICulture.ClearCachedData();
#endif
Expand Down
8 changes: 4 additions & 4 deletions src/Test/Utilities/Portable/Compilation/RuntimeUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static partial class RuntimeUtilities
{
internal static BuildPaths CreateBuildPaths(string workingDirectory)
{
#if NET461 || NET46
#if NET46
return new BuildPaths(
clientDir: Path.GetDirectoryName(typeof(BuildPathsUtil).Assembly.Location),
workingDir: workingDirectory,
Expand All @@ -32,7 +32,7 @@ internal static BuildPaths CreateBuildPaths(string workingDirectory)

internal static IRuntimeEnvironmentFactory GetRuntimeEnvironmentFactory()
{
#if NET461 || NET46
#if NET46
return new Roslyn.Test.Utilities.Desktop.DesktopRuntimeEnvironmentFactory();
#elif NETCOREAPP2_0
return new Roslyn.Test.Utilities.CoreClr.CoreCLRRuntimeEnvironmentFactory();
Expand All @@ -45,7 +45,7 @@ internal static IRuntimeEnvironmentFactory GetRuntimeEnvironmentFactory()

internal static AnalyzerAssemblyLoader CreateAnalyzerAssemblyLoader()
{
#if NET461 || NET46
#if NET46
return new DesktopAnalyzerAssemblyLoader();
#else
return new ThrowingAnalyzerAssemblyLoader();
Expand All @@ -57,7 +57,7 @@ internal static AnalyzerAssemblyLoader CreateAnalyzerAssemblyLoader()
/// </summary>
internal static string GetAssemblyLocation(Type type)
{
#if NET461 || NET46 || NETCOREAPP2_0
#if NET46 || NETCOREAPP2_0
return type.GetTypeInfo().Assembly.Location;
#elif NETSTANDARD1_3
throw new NotSupportedException();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

#if NET461 || NET46
#if NET46

using System;
using System.Collections.Concurrent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#if NET461 || NET46
#if NET46
using System;
using System.IO;
using System.Reflection;
Expand Down
2 changes: 1 addition & 1 deletion src/Test/Utilities/Portable/Platform/Desktop/CLRHelpers.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#if NET461 || NET46
#if NET46

using System;
using System.Collections.Generic;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#if NET461 || NET46
#if NET46

using System;
using System.Drawing;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

#if NET461 || NET46
#if NET46

using System;
using System.Collections.Generic;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET461 || NET46
#if NET46
using System.Collections.Generic;
using Roslyn.Test.Utilities;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET461 || NET46
#if NET46
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

#if NET461 || NET46
#if NET46
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down
2 changes: 1 addition & 1 deletion src/Test/Utilities/Portable/Platform/Desktop/Exceptions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

#if NET461 || NET46
#if NET46
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
Expand Down
2 changes: 1 addition & 1 deletion src/Test/Utilities/Portable/Platform/Desktop/Extensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

#if NET461 || NET46
#if NET46
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

#if NET461 || NET46
#if NET46
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#if NET461 || NET46
#if NET46

using System;
using System.Collections.Concurrent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET461 || NET46
#if NET46
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
Expand Down

0 comments on commit a77e70a

Please sign in to comment.