Add "opaque blob of bytes" field also to bindings of #[repr(C)] enums.#563
Closed
copybara-service[bot] wants to merge 1 commit intomainfrom
Closed
Add "opaque blob of bytes" field also to bindings of #[repr(C)] enums.#563copybara-service[bot] wants to merge 1 commit intomainfrom
#[repr(C)] enums.#563copybara-service[bot] wants to merge 1 commit intomainfrom
Conversation
In the future (in a follow-up CL) we plan to auto-generate "constructors" that can create an `enum` instance by populating an `__opaque_blob_of_bytes` field - see https://godbolt.org/z/7nETfcxax This CL adds a `__opaque_blob_of_bytes` field to `#[repr(C)]` `enum`s. This helps to provide a consistent, unified "API" that future `enum` "constructors" can used. The new field has to be public, because otherwise Clang reports an error saying that "anonymous union cannot contain a private data member". Therefore to signify that the field is only meant for internal usage this CL renames the field to `__crubit_internal_blob_of_bytes`. PiperOrigin-RevId: 875946440
1504e24 to
01ae416
Compare
__opaque_blob_of_bytes also to bindings of #[repr(C)] enums.#[repr(C)] enums.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add "opaque blob of bytes" field also to bindings of
#[repr(C)]enums.In the future (in a follow-up CL) we plan to auto-generate
"constructors" that can create an
enuminstance by populatingan
__opaque_blob_of_bytesfield - see https://godbolt.org/z/7nETfcxaxThis CL adds a
__opaque_blob_of_bytesfield to#[repr(C)]enums.This helps to provide a consistent, unified "API" that future
enum"constructors" can used.The new field has to be public, because otherwise Clang reports an error
saying that "anonymous union cannot contain a private data member".
Therefore to signify that the field is only meant for internal usage
this CL renames the field to
__crubit_internal_blob_of_bytes.