Skip to content

Commit a4c5a3d

Browse files
committed
Renamed OnlySupportedInNetstandard21 to NotSupportedInNetstandard20 and also use !NETSTANDARD2_0 as a check for the define.
1 parent b5151f2 commit a4c5a3d

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

tools/Magick.NET.SourceGenerator/Helpers/MethodInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ public bool IsVoid
5252

5353
public bool IsStatic { get; }
5454

55-
public bool OnlySupportedInNetstandard21
56-
=> ReturnType.OnlySupportedInNetstandard21 ||
57-
Parameters.Any(parameter => parameter.Type.OnlySupportedInNetstandard21);
55+
public bool NotSupportedInNetstandard20
56+
=> ReturnType.NotSupportedInNetstandard20 ||
57+
Parameters.Any(parameter => parameter.Type.NotSupportedInNetstandard20);
5858

5959
public string Name
6060
=> _method.Identifier.Text;

tools/Magick.NET.SourceGenerator/Helpers/TypeInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public bool IsFixed
7070
_ => false,
7171
};
7272

73-
public bool OnlySupportedInNetstandard21
73+
public bool NotSupportedInNetstandard20
7474
=> Name switch
7575
{
7676
"ReadOnlySpan<byte>" => true,

tools/Magick.NET.SourceGenerator/NativeInterop/NativeInteropGenerator.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ private static void AppendNativeInterop(CodeBuilder codeBuilder, NativeInteropIn
126126
{
127127
var useInstance = info.HasInstance && method.UsesInstance;
128128

129-
if (method.OnlySupportedInNetstandard21)
130-
codeBuilder.AppendLine("#if NETSTANDARD2_1");
129+
if (method.NotSupportedInNetstandard20)
130+
codeBuilder.AppendLine("#if !NETSTANDARD2_0");
131131

132132
codeBuilder.Append("[DllImport(NativeLibrary.");
133133
codeBuilder.Append(name);
@@ -173,7 +173,7 @@ private static void AppendNativeInterop(CodeBuilder codeBuilder, NativeInteropIn
173173
codeBuilder.Append(")");
174174
codeBuilder.AppendLine(";");
175175

176-
if (method.OnlySupportedInNetstandard21)
176+
if (method.NotSupportedInNetstandard20)
177177
codeBuilder.AppendLine("#endif");
178178
}
179179

@@ -269,8 +269,8 @@ private static void AppendNativeClassInstanceMethods(CodeBuilder codeBuilder, Na
269269
private static void AppendNativeMethod(CodeBuilder codeBuilder, NativeInteropInfo info, MethodInfo method)
270270
{
271271
codeBuilder.AppendLine();
272-
if (method.OnlySupportedInNetstandard21)
273-
codeBuilder.AppendLine("#if NETSTANDARD2_1");
272+
if (method.NotSupportedInNetstandard20)
273+
codeBuilder.AppendLine("#if !NETSTANDARD2_0");
274274

275275
codeBuilder.Append("public ");
276276
if (method.IsStatic)
@@ -471,7 +471,7 @@ private static void AppendNativeMethod(CodeBuilder codeBuilder, NativeInteropInf
471471

472472
codeBuilder.AppendCloseBrace();
473473

474-
if (method.OnlySupportedInNetstandard21)
474+
if (method.NotSupportedInNetstandard20)
475475
codeBuilder.AppendLine("#endif");
476476
}
477477

0 commit comments

Comments
 (0)