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

wrap_fn_ptr!: Generate a decl_fn! macro inside; also document macros #580

Merged
merged 9 commits into from
Dec 1, 2023

Conversation

kkysen
Copy link
Collaborator

@kkysen kkysen commented Nov 21, 2023

We're already matching the fn signature with a macro, so generating the decl_fn! macro inside is pretty trivial, and this way we don't have to write all of the decl_*_fn! macros ourselves.

This also adds documentation for:

  • trait HasFnPtr
  • struct WrappedFnPtr
  • wrap_fn_ptr!
  • bd_fn!

@kkysen kkysen requested a review from randomPoison November 21, 2023 03:52
@kkysen kkysen force-pushed the kkysen/macro-enum_map_ty branch from 3f9a4c8 to b72a63d Compare November 21, 2023 03:58
@kkysen kkysen force-pushed the kkysen/macro-wrap_fn_ptr-decl_fn branch from 6e38a36 to fa0e67f Compare November 21, 2023 03:58
@kkysen kkysen force-pushed the kkysen/macro-enum_map_ty branch from b72a63d to d14077c Compare November 27, 2023 06:27
@kkysen kkysen force-pushed the kkysen/macro-wrap_fn_ptr-decl_fn branch from fa0e67f to 5bda2e8 Compare November 27, 2023 06:27
Base automatically changed from kkysen/macro-enum_map_ty to main November 27, 2023 07:05
Copy link
Collaborator

@rinon rinon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish we didn't need the decl_fn macros at all, but this is cleaner than writing them all out since we already have all the params in the wrapper macro.

src/wrap_fn_ptr.rs Show resolved Hide resolved
@kkysen kkysen force-pushed the kkysen/macro-wrap_fn_ptr-decl_fn branch from 5bda2e8 to 336bb06 Compare November 29, 2023 06:00
@kkysen kkysen requested a review from rinon November 29, 2023 06:02
@kkysen kkysen changed the title wrap_fn_ptr!: Generate a decl_fn! macro inside wrap_fn_ptr!: Generate a decl_fn! macro inside; also document macros Nov 29, 2023
src/wrap_fn_ptr.rs Outdated Show resolved Hide resolved
src/wrap_fn_ptr.rs Show resolved Hide resolved
include/common/bitdepth.rs Show resolved Hide resolved
include/common/bitdepth.rs Outdated Show resolved Hide resolved
@kkysen kkysen requested a review from rinon November 30, 2023 06:54
@kkysen kkysen merged commit 1d628da into main Dec 1, 2023
18 checks passed
@kkysen kkysen deleted the kkysen/macro-wrap_fn_ptr-decl_fn branch December 1, 2023 23:59
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.

2 participants