Skip to content

Commit

Permalink
Remove noisy line and file macros from generation
Browse files Browse the repository at this point in the history
  • Loading branch information
kostya9 committed Oct 8, 2023
1 parent a285b70 commit bad2b11
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion NetObsBindings/NetObsBindings.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PropertyGroup>

<PropertyGroup>
<PackageVersion>0.0.1.37-alpha</PackageVersion>
<PackageVersion>0.0.1.38-alpha</PackageVersion>

<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<ProjectUrl>https://github.com/kostya9/NetObsBindings</ProjectUrl>
Expand Down
Binary file modified NetObsBindings/Obs.Version.cs
Binary file not shown.
10 changes: 0 additions & 10 deletions NetObsBindings/ObsInterop/ObsBase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Runtime.InteropServices;

namespace ObsInterop;
Expand All @@ -21,13 +20,4 @@ public static unsafe partial class ObsBase

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void bcrash([NativeTypeName("const char *")] sbyte* format, __arglist);

[NativeTypeName("#define S__LINE__ STRINGIFY_(__LINE__)")]
public static ReadOnlySpan<byte> S__LINE__ => "9"u8;

[NativeTypeName("#define INT_CUR_LINE __LINE__")]
public const int INT_CUR_LINE = 11;

[NativeTypeName("#define FILE_LINE __FILE__ \" (\" S__LINE__ \"): \"")]
public static ReadOnlySpan<byte> FILE_LINE => ".\\generate\\util\\obs-util.h (13): "u8;
}
6 changes: 5 additions & 1 deletion generate_bindings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ function Get-ObsClassName {

$config = "multi-file", "generate-file-scoped-namespaces", "generate-helper-types", "exclude-funcs-with-body", "generate-macro-bindings", "latest-codegen"
$replacements = "[email protected]", "[email protected]", "[email protected]", "half=@Half", "[email protected]<Single>", "[email protected]", "_iobuf*=@nint","stat*=@nint"
$excludes = "blogva", "blog", "ARCH_BITS"
$excludes = @(
"blogva", "blog", <# this method uses __arglist (variable argument list in C) but it is not fully supported in .NET (e.g. on Linux it just crashes) #>
"ARCH_BITS", <# manually implemented for .NET #>
"S__LINE__", "INT_CUR_LINE", "FILE_LINE" <# macroses for line and file in C, doesnt't work well in C# #>
)

$obsModuleTracersals = @(
".\obs-studio\libobs\obs-source.h",
Expand Down

0 comments on commit bad2b11

Please sign in to comment.