Skip to content

Conversation

nicholasbishop
Copy link
Member

There are several places where we copy a rather abstruse pattern from the nomicon for representing opaque structs for FFI purposes 1. This is necessary until such time as as a proper extern type 2 is stabilized.

To avoid having to copy-paste this pattern, add a simple macro for it.

Checklist

  • Sensible git history (for example, squash "typo" or "fix" commits). See the Rewriting History guide for help.
  • Update the changelog (if necessary)

There are several places where we copy a rather abstruse pattern from the
nomicon for representing opaque structs for FFI purposes [1]. This is necessary
until such time as as a proper extern type [2] is stabilized.

To avoid having to copy-paste this pattern, add a simple macro for it.

[1]: https://doc.rust-lang.org/stable/nomicon/ffi.html#representing-opaque-structs
[2]: https://rust-lang.github.io/rfcs/1861-extern-types.html
@phip1611 phip1611 force-pushed the bishop-opaque-macro branch from 00a33df to a71fb2f Compare March 27, 2023 06:49
@nicholasbishop nicholasbishop merged commit e64e166 into rust-osdev:main Mar 27, 2023
@nicholasbishop nicholasbishop deleted the bishop-opaque-macro branch March 27, 2023 16:57
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