Skip to content

Remove [extern_c] attribute from WinSDK module. #30527

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
Mar 20, 2020

Conversation

martinboehme
Copy link
Contributor

@martinboehme martinboehme commented Mar 20, 2020

I've verified that all of the header files in this module already contain their own extern "C" blocks that are activated if compiling as C++.

The additional [extern_c] attribute causes problems for some headers, like PathCch.h, that define additional overloads of functions when compiled as C++. The "global" [extern_c] essentially switches off name mangling for these overloads, which causes them to conflict with the functions they are overloading.

See here for more context:
#30233 (comment)

See here for an example of failures caused by the [extern_c]:
https://ci-external.swift.org/job/swift-PR-windows/869/console
(Search for "PathCch.h".)

I've verified that all of the header files in this module already
contain their own `extern "C"` blocks that are activated if compiling as
C++.

The additional [extern_c] attribute causes problems for some headers,
like PathCch.h, that define additional overloads of functions when
compiled as C++. The "global" [extern_c] essentially switches off name
mangling with these overloads, which causes them to conflict with the
functions they are overloading.

See here for more context:
swiftlang#30233 (comment)

See here for an example of failures caused by the [extern_c]:
https://ci-external.swift.org/job/swift-PR-windows/869/console

(Search for "PathCch.h".)
@gribozavr
Copy link
Contributor

@swift-ci Please test Windows platform

@martinboehme
Copy link
Contributor Author

CC @compnerd I'd appreciate it if you could take a look!

@compnerd
Copy link
Member

compnerd commented Mar 20, 2020

Hmm, I wish I remembered what caused the “extern_c”, but, if it passes CI, sounds good to me. I’ll test it more thoroughly later.

This fixes one of the two tests, the second test being generalized probably is the easiest thing, and we can opt for that and this over reverting I think of everything passes.

@compnerd
Copy link
Member

@swift-ci please smoke test

@gribozavr
Copy link
Contributor

@swift-ci Please smoke test

@gribozavr gribozavr merged commit 7bc4148 into swiftlang:master Mar 20, 2020
@martinboehme martinboehme deleted the winsdk-modulemap branch April 6, 2020 14:33
@gribozavr gribozavr added the c++ interop Feature: Interoperability with C++ label May 7, 2020
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