-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support defining C-compatible variadic functions in Rust #2137
Merged
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
019dff4
Support defining C-compatible variadic functions in Rust
joshtriplett 3039f17
Add VaArg for size_t and ssize_t; sort and group the VaArg impls better
joshtriplett 12eb69f
Allow calling extern "C" functions that accept a `va_list`
joshtriplett e6b5cfb
Drop variadic closures
joshtriplett e9fe291
Fix typo in sample code
joshtriplett 247991e
Drop impls for libc, mention that type aliases cover this
joshtriplett 0cca2ce
Make VaArg an unsafe trait
joshtriplett 3161c45
Fix typo in sample code
joshtriplett 7b7b3ff
Drop VaList::start; name the VaList argument instead, to improve life…
joshtriplett 9d060c4
Declare args as `mut`
joshtriplett 3769670
Rework the alternatives; the new syntax isn't the "alternative" anymore
joshtriplett 63b5545
Fix another reference to VaList::start
joshtriplett 5437ab2
Clarify the description of argument promotion
joshtriplett 7bd8d7d
Get rid of the VaArg trait
joshtriplett 96f80ac
Don't impl `Drop` directly; just talk about the necessary drop semantics
joshtriplett 18a8b36
Fix `extern "C"` function declarations
joshtriplett 7e5698e
Allow `VaList::arg` to return any type usable in an `extern "C" fn` s…
joshtriplett 105f764
Use `extern type` to declare `VaList` (see RFC 1861)
joshtriplett 6bdb95c
Move the mention of language items to the reference-level explanation
joshtriplett 1546c82
Use the rustdoc-style `/* fields omitted */` syntax to declare VaList
joshtriplett eca3eae
Require that the function have at least one non-variadic argument
joshtriplett e3d1f5c
Add some clarifications on drop handling, and non-standard behavior
joshtriplett b2acc33
Stop using Clone; implement copy safely via a closure
joshtriplett 4042834
Add an unresolved question on support for non-native ABIs
joshtriplett eb9c392
RFC 2137: Support defining C-compatible variadic functions in Rust
aturon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Stop using Clone; implement copy safely via a closure
Huge thanks to Without Boats for help working out the details here.
- Loading branch information
commit b2acc33c3bb7c2a575647ca109338b281fc32af2
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The standard only sayswhich I take to mean that you're allowed to pass ava_list *pap
to a function which will callva_end(*pap)
for you. Although I don't imagine this ever happening at cross-module boundary, so you might get away with ignoring this possibility.Forget what I said.