Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace macro_rules! macros with proc_macros + general cleanup #97

Conversation

danielhenrymantilla
Copy link
Collaborator

@danielhenrymantilla danielhenrymantilla commented Apr 13, 2022

Fixes #46

Implemented the new #[derive_ReprC] and some accompanying ffi_export! logic.

  • this gets rid of the need of the macros in layout/macros.rs unless the js experimental feature is enabled and we are dealing with a repr(C, node_js) type.

  • most macros are thus implemented using procedural macro code.

  • most of the header generation logic is factored out into a pluggable headers/languages/ system thanks to a new dyn HeaderLanguage trait.

  • Incidentally, this implements rename =ing on #[derive_ReprC(…)], as well as fixing the issue with a generic opaque type (Using generics in struct does not create separate monomorphized types #99).

    It also makes it so more instances of unit and braced structs are supported.

danielhenrymantilla and others added 6 commits May 18, 2022 22:19
…rt!` logic.

  - this gets rid of the need of the macros in `layout/macros.rs` unless the `js`
    feature is enabled and we are dealing with a `repr(C, node_js)` type.

  - most macros are thus implemented using procedural macro code.

  - Most of the header generation logic is factored out into a pluggable
    `headers/languages/` system thanks to a new `dyn HeaderLanguage` trait.

  - Incidentally, this implements `rename =`ing on `#[derive_ReprC(…)]`, as well
    as fixing the issue with a generic opaque type.

    It also makes it so more instances of unit and braced structs are supported.
* Builder::generate_with_definer has been splitted in subfunction for
better readability
* added type alias GenerationFunction
* added NameConvention option on builder

Co-Authored-By: Ronan Demimuid <ronan@ditto.live>
@danielhenrymantilla danielhenrymantilla force-pushed the cleanup-replace-macro-rules-with-proc-macros branch from 3918d05 to b22bd95 Compare May 18, 2022 20:19
@danielhenrymantilla
Copy link
Collaborator Author

danielhenrymantilla commented May 18, 2022

@ronan-ditto I've cleaned up the commit history; but if that were to cause trouble for your other branch, you can git fetch --tags and then use the cleanup-replace-macro-rules-with-proc-macros-snapshot-1 tag as a reference to the branch before my forced push 🙂

@danielhenrymantilla danielhenrymantilla force-pushed the cleanup-replace-macro-rules-with-proc-macros branch 2 times, most recently from 4a78abb to 7f515a9 Compare June 28, 2022 17:14
@danielhenrymantilla danielhenrymantilla force-pushed the cleanup-replace-macro-rules-with-proc-macros branch from 7f515a9 to 64cd908 Compare June 28, 2022 17:23
@danielhenrymantilla danielhenrymantilla merged commit b30bc99 into ffi-safe-dyn-traits Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant