Skip to content

[cxx-interop] Provide a support header for common attributes, etc. #63839

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 4 commits into from
Feb 27, 2023

Conversation

zoecarver
Copy link
Contributor

No description provided.

@zoecarver
Copy link
Contributor Author

@swift-ci Please Build Toolchain macOS Platform

__attribute__((swift_attr(_CXX_INTEROP_STRINGIFY(retain:_retain)))) \
__attribute__((swift_attr(_CXX_INTEROP_STRINGIFY(release:_release))))

#define SWIFT_NAME(_name) __attribute__((swift_name(#_name)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think SWIFT_NAME belongs here: it isn't specific to C++ interop, it is also used for C/ObjC interop. On Darwin there's an existing macro for this (NS_SWIFT_NAME), is this a replacement for NS_SWIFT_NAME?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking more about non-darwin platforms or users that don't have access to or don't want to use Foundation (the place this macro is currently provided).

@zoecarver
Copy link
Contributor Author

@swift-ci Please Build Toolchain macOS Platform

@hyp hyp added the c++ interop Feature: Interoperability with C++ label Feb 23, 2023
@zoecarver
Copy link
Contributor Author

@swift-ci please test

@zoecarver zoecarver merged commit c9ef886 into swiftlang:main Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants