-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from NordSecurity/issue-28
Fix the ffi constructor's type case issue (#28)
- Loading branch information
Showing
10 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using uniffi.issue_28; | ||
|
||
namespace UniffiCS.BindingTests; | ||
|
||
public class ClassIssue28 | ||
{ | ||
[Fact] | ||
public void TestIssue28() | ||
{ | ||
new AsdfObject(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
name = "issue-28" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[lib] | ||
crate-type = ["lib", "cdylib"] | ||
name = "issue_28" | ||
|
||
[dependencies] | ||
uniffi = {path = "../../../3rd-party/uniffi-rs/uniffi", features=["build"]} | ||
uniffi_macros = {path = "../../../3rd-party/uniffi-rs/uniffi_macros"} | ||
|
||
[build-dependencies] | ||
uniffi = {path = "../../../3rd-party/uniffi-rs/uniffi", features=["bindgen-tests"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
https://github.com/NordSecurity/uniffi-bindgen-cs/issues/28 | ||
|
||
If the interface's name is like `ASDFObject`, typenames are not generated uniformly. | ||
There will be a difference between the class name `AsdfObject` and the return type of the ffi constructor `ASDFObject`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
uniffi::generate_scaffolding("src/issue-28.udl").unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace issue_28 { | ||
|
||
}; | ||
|
||
interface ASDFObject { | ||
constructor(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
pub struct ASDFObject {} | ||
|
||
impl ASDFObject { | ||
fn new() -> ASDFObject { | ||
ASDFObject {} | ||
} | ||
} | ||
|
||
uniffi::include_scaffolding!("issue-28"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters