Skip to content

Cannot build when C++ interoperability is used #88

Closed
@arguiot

Description

@arguiot

Issue description

When attempting to build the apple/swift-atomics library with C++ interoperability enabled, several errors are encountered in the _AtomicsShims.h header file. These errors prevent the library from being built successfully.

Steps to reproduce

  1. Use the apple/swift-atomics package in a target using SwiftPM.
  2. Configure the build with C++ interoperability enabled.
  3. Attempt to build the library.

Expected behavior

The library should build successfully with C++ interoperability enabled. The library should correctly detect that C++ inter is enabled instead of blindly assuming that interoperability will be C/Objective-C

Actual behavior

Several errors are encountered in the _AtomicsShims.h header file, preventing the library from being built successfully.

Error messages

swift-atomics/Sources/_AtomicsShims/include/_AtomicsShims.h:227:1: Cannot initialize a member subobject of type '_Atomic(_sa_dword)' with an rvalue of type '_Atomic(_sa_dword)'

swift-atomics/Sources/_AtomicsShims/include/_AtomicsShims.h:227:1: No viable conversion from returned value of type '_Atomic(_sa_dword)' to function return type '_sa_dword'

Could not build Objective-C module '_AtomicsShims'

Environment

  • Operating system: macOS 14.0 Sonoma
  • Compiler: Apple Swift version 5.9

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions