Skip to content

Make AtomicsShims compatible with C++ interop #118

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

egorzhdan
Copy link

@egorzhdan egorzhdan commented May 30, 2025

This fixes linker errors such as

Undefined symbols for architecture arm64:
  "_sa_retain_n(void*, unsigned int)", referenced from:
      (extension in Atomics):Swift.Unmanaged.retain(by: Swift.Int) -> () in Unmanaged extensions.swift.o
   NOTE: found '__sa_retain_n' in _AtomicsShims.c.o, declaration possibly missing 'extern "C"'

when building with Swift/C++ interoperability enabled.

Checklist

  • I've read the Contribution Guidelines
  • My contributions are licensed under the Swift license.
  • I've followed the coding style of the rest of the project.
  • I've added tests covering all new code paths my change adds to the project (if appropriate).
  • I've verified that my change does not break any existing tests.
  • I've updated the documentation if necessary.

This fixes linker errors such as
```
Undefined symbols for architecture arm64:
  "_sa_retain_n(void*, unsigned int)", referenced from:
      (extension in Atomics):Swift.Unmanaged.retain(by: Swift.Int) -> () in Unmanaged extensions.swift.o
   NOTE: found '__sa_retain_n' in _AtomicsShims.c.o, declaration possibly missing 'extern "C"'
```
when building with Swift/C++ interoperability enabled.
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.

1 participant