Skip to content

runtime: annotate _environ DLL storage, exclude in WinRT #37810

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
Jun 7, 2021

Conversation

compnerd
Copy link
Member

@compnerd compnerd commented Jun 7, 2021

_environ is meant to be DLL imported when linking against the C
runtime dynamically (/MD or /MDd). However, when building for
the Windows Runtime environment, we cannot support the use of _environ
and thus disable the support for that. _WINRT_DLL identifies the
combination of /ZW and /LD or /LDd. Windows Runtime builds cannot
be executables (and obviously not static libraries as they are not
executable), and thus we properly disable ENVIRON in all Windows
Runtime builds.

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

Resolves SR-NNNN.

`_environ` is meant to be DLL imported when linking against the C
runtime dynamically (`/MD` or `/MDd`).  However, when building for
the Windows Runtime environment, we cannot support the use of `_environ`
and thus disable the support for that.  `_WINRT_DLL` identifies the
combination of `/ZW` and `/LD` or `/LDd`.  Windows Runtime builds cannot
be executables (and obviously not static libraries as they are not
executable), and thus we properly disable `ENVIRON` in all Windows
Runtime builds.
@compnerd
Copy link
Member Author

compnerd commented Jun 7, 2021

CC: @mikeash

@compnerd
Copy link
Member Author

compnerd commented Jun 7, 2021

@swift-ci please test

@compnerd compnerd merged commit e44dbfc into swiftlang:main Jun 7, 2021
@compnerd compnerd deleted the enviromentally-friendly branch June 7, 2021 15:08
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