From 549fb4635017c77bfb5baab2e2cf1e303748db70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bennet=20Ble=C3=9Fmann?= Date: Fri, 8 Sep 2023 20:29:40 +0200 Subject: [PATCH] fix braking change of Cysharp/csbindgen#48 --- csbindgen/src/builder.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/csbindgen/src/builder.rs b/csbindgen/src/builder.rs index 82fc5a2..e647260 100644 --- a/csbindgen/src/builder.rs +++ b/csbindgen/src/builder.rs @@ -185,6 +185,13 @@ impl Builder { self } + /// configure C# generate const, default is false + /// equivalent to csharp_generate_const_filter(|_| csharp_generate_const) + #[deprecated(note = "User csharp_generate_const_filter instead")] + pub fn csharp_generate_const(mut self, csharp_generate_const: bool) -> Builder { + self.csharp_generate_const_filter(if csharp_generate_const { |_| true } else { |_| false }) + } + /// configure C# generate const filter, default `|_| false` pub fn csharp_generate_const_filter(mut self, csharp_generate_const_filter: fn(const_name: &str) -> bool) -> Builder { self.options.csharp_generate_const_filter = csharp_generate_const_filter;