Skip to content

Shims: match the declared type for CF interfaces #14492

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

Merged
merged 1 commit into from
Feb 10, 2018

Conversation

compnerd
Copy link
Member

@compnerd compnerd commented Feb 8, 2018

CFHashBytes takes a CFIndex, not a long. Because this type is
declared differently on different platforms, desugaring the type can
cause mismatches. Make the shims match the real declarations in
swift-corelibs-foundation.

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

`CFHashBytes` takes a `CFIndex`, not a `long`.  Because this type is
declared differently on different platforms, desugaring the type can
cause mismatches.  Make the shims match the real declarations in
swift-corelibs-foundation.
@compnerd compnerd requested a review from phausler February 8, 2018 22:30
@compnerd
Copy link
Member Author

compnerd commented Feb 8, 2018

@swift-ci please test

@compnerd
Copy link
Member Author

compnerd commented Feb 9, 2018

@jrose-apple could you please poke @phausler? This is pretty trivial.

@jrose-apple
Copy link
Contributor

Maybe @millenomi can get to it sooner?

@phausler
Copy link
Contributor

What platform is CFIndex not pointer sized? If so it probably should be corrected. Iirc the reason why the type was desugared is that was that way before we fixed it in CF (pre-export to swift-corelibs-foundation)

The change listed seems isomorphic so I have no problems with it being CFIndex or for that matter even ssize_t (albeit perhaps size_t might be better)

@jrose-apple
Copy link
Contributor

I think it's the other way around: on Windows long is not pointer-sized and CFIndex is.

@jrose-apple
Copy link
Contributor

@compnerd I think it's okay to merge even if we keep discussing.

@compnerd compnerd merged commit 94a35a1 into swiftlang:master Feb 10, 2018
@compnerd compnerd deleted the CFHashType branch February 10, 2018 18:28
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.

3 participants