openssl-sys: declare_std_functions macro #1348
Closed
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.
Hi,
I have been looking for a way to handle the
*mut _
->*const _
changes in openssl / libressl in a sane way; duplicating all the imports seemed a bad thing.With proc-macros one could probably invent real crazy syntax, but that would add a lot of dependencies for
openssl-sys
.The best thing I could come up with was to define signature schemes (with a single type parameter), which can then be applied using a macro syntax I borrowed from foreign_types. (Macros are not allowed in type position (and name/ident?), so I couldn't get any other "fix this type signature" attempts working).
This will probably add a big merge conflict with the
openssl-300
branch, but hopefully makes the process easier in the long run.Also this changes
u8
toc_uchar
in a fewd2i_*
andi2d_
functions; I think this shouldn't break anything (libc::c_uchar
should be an alias foru8
), but is actually the proper signature.I checked the imported functions on my local system with my systest-api-items branch, which is based on my ctest out-items branch. After
sed -e 's#uint8_t#unsigned char#'
the items look the same before and after this PR.