{"action":"created","issue":{"url":"https://api.github.com/repos/apple/swift/issues/3337","repository_url":"https://api.github.com/repos/apple/swift","labels_url":"https://api.github.com/repos/apple/swift/issues/3337/labels{/name}","comments_url":"https://api.github.com/repos/apple/swift/issues/3337/comments","events_url":"https://api.github.com/repos/apple/swift/issues/3337/events","html_url":"https://github.com/apple/swift/pull/3337","id":163714268,"number":3337,"title":"basic: introduce the _environment compilation conditional","user":{"login":"compnerd","id":63311,"avatar_url":"https://avatars.githubusercontent.com/u/63311?v=3","gravatar_id":"","url":"https://api.github.com/users/compnerd","html_url":"https://github.com/compnerd","followers_url":"https://api.github.com/users/compnerd/followers","following_url":"https://api.github.com/users/compnerd/following{/other_user}","gists_url":"https://api.github.com/users/compnerd/gists{/gist_id}","starred_url":"https://api.github.com/users/compnerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/compnerd/subscriptions","organizations_url":"https://api.github.com/users/compnerd/orgs","repos_url":"https://api.github.com/users/compnerd/repos","events_url":"https://api.github.com/users/compnerd/events{/privacy}","received_events_url":"https://api.github.com/users/compnerd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2016-07-04T17:13:17Z","updated_at":"2016-07-07T21:58:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apple/swift/pulls/3337","html_url":"https://github.com/apple/swift/pull/3337","diff_url":"https://github.com/apple/swift/pull/3337.diff","patch_url":"https://github.com/apple/swift/pull/3337.patch"},"body":"<!-- Please complete this template before creating the pull request. -->\r\n#### What's in this pull request?\r\n<!-- Description about pull request. -->\r\n\r\n#### Resolved bug number: ([SR-](https://bugs.swift.org/browse/SR-))\r\n<!-- If this pull request resolves any bugs from Swift bug tracker -->\r\n\r\n* * * *\r\n\r\n<!-- This selection should only be completed by Swift admin -->\r\nBefore merging this pull request to apple/swift repository:\r\n- [ ] Test pull request on Swift continuous integration.\r\n\r\n<details>\r\n  <summary>Triggering Swift CI</summary>\r\n\r\nThe swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:\r\n\r\n**Smoke Testing**\r\n\r\n        Platform     | Comment\r\n        ------------ | -------------\r\n        All supported platforms     | @swift-ci Please smoke test\r\n        All supported platforms     | @swift-ci Please smoke test and merge\r\n        OS X platform               | @swift-ci Please smoke test OS X platform\r\n        Linux platform              | @swift-ci Please smoke test Linux platform\r\n\r\n**Validation Testing**\r\n\r\n        Platform     | Comment\r\n        ------------ | -------------\r\n        All supported platforms     | @swift-ci Please test\r\n        All supported platforms     | @swift-ci Please test and merge\r\n        OS X platform               | @swift-ci Please test OS X platform\r\n        OS X platform               | @swift-ci Please benchmark\r\n        Linux platform              | @swift-ci Please test Linux platform\r\n\r\n\r\n**Lint Testing**\r\n\r\n        Language     | Comment\r\n        ------------ | -------------\r\n        Python       | @swift-ci Please Python lint\r\n\r\nNote: Only members of the Apple organization can trigger swift-ci.\r\n</details>\r\n<!-- Thank you for your contribution to Swift! -->\r\n\r\nWindows has multiple environment flavours, each of which are different.  cygwin\r\nprovides a glibc based environment, MinGW provides a msvcrt based GNU\r\nenvironment, itanium provides a msvc environment with an itanium C++ ABI, and\r\nmsvc is the pure msvc, msvcprt based environment as vended by Microsoft.  Due to\r\nthe differences in the environment, we need a means to differentiate them at the\r\nstdlib level.  Provide the _environment conditional which would allow you to\r\nquery what environment is being targeted."},"comment":{"url":"https://api.github.com/repos/apple/swift/issues/comments/231220121","html_url":"https://github.com/apple/swift/pull/3337#issuecomment-231220121","issue_url":"https://api.github.com/repos/apple/swift/issues/3337","id":231220121,"user":{"login":"tinysun212","id":12603793,"avatar_url":"https://avatars.githubusercontent.com/u/12603793?v=3","gravatar_id":"","url":"https://api.github.com/users/tinysun212","html_url":"https://github.com/tinysun212","followers_url":"https://api.github.com/users/tinysun212/followers","following_url":"https://api.github.com/users/tinysun212/following{/other_user}","gists_url":"https://api.github.com/users/tinysun212/gists{/gist_id}","starred_url":"https://api.github.com/users/tinysun212/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tinysun212/subscriptions","organizations_url":"https://api.github.com/users/tinysun212/orgs","repos_url":"https://api.github.com/users/tinysun212/repos","events_url":"https://api.github.com/users/tinysun212/events{/privacy}","received_events_url":"https://api.github.com/users/tinysun212/received_events","type":"User","site_admin":false},"created_at":"2016-07-07T21:58:53Z","updated_at":"2016-07-07T21:58:53Z","body":"Thanks for your mention.\r\n\r\nI started similar discussion in #2351 and [swift-evolution](https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160502/thread.html#16381), but it is discontinued.\r\nI am positive to the approach in this PR, it will be useful for Foundation porting as well as standard library porting.\r\n\r\nI tried ad hoc -D flag in [Foundation PR](https://github.com/apple/swift-corelibs-foundation/pull/381). In there, the code is like this.\r\n```\r\n#if os(OSX) || os(iOS)\r\n    import Darwin\r\n#elseif os(Linux) || IS_CYGWIN\r\n    import Glibc\r\n#endif\r\n``` \r\nI think if we use the method 'ad hoc -D flag', we need the convention for the macro name.\r\n"}}
{"actor":{"display_login":"tinysun212"}}