{"action":"created","issue":{"url":"https://api.github.com/repos/mono/mono/issues/9814","repository_url":"https://api.github.com/repos/mono/mono","labels_url":"https://api.github.com/repos/mono/mono/issues/9814/labels{/name}","comments_url":"https://api.github.com/repos/mono/mono/issues/9814/comments","events_url":"https://api.github.com/repos/mono/mono/issues/9814/events","html_url":"https://github.com/mono/mono/pull/9814","id":346009415,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0OTc3NjMy","number":9814,"title":"[cxx] Alternate strategy for extern \"C\".","user":{"login":"jaykrell","id":1635728,"node_id":"MDQ6VXNlcjE2MzU3Mjg=","avatar_url":"https://avatars1.githubusercontent.com/u/1635728?v=4","gravatar_id":"","url":"https://api.github.com/users/jaykrell","html_url":"https://github.com/jaykrell","followers_url":"https://api.github.com/users/jaykrell/followers","following_url":"https://api.github.com/users/jaykrell/following{/other_user}","gists_url":"https://api.github.com/users/jaykrell/gists{/gist_id}","starred_url":"https://api.github.com/users/jaykrell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaykrell/subscriptions","organizations_url":"https://api.github.com/users/jaykrell/orgs","repos_url":"https://api.github.com/users/jaykrell/repos","events_url":"https://api.github.com/users/jaykrell/events{/privacy}","received_events_url":"https://api.github.com/users/jaykrell/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-07-31T02:13:45Z","updated_at":"2018-07-31T21:41:19Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/mono/mono/pulls/9814","html_url":"https://github.com/mono/mono/pull/9814","diff_url":"https://github.com/mono/mono/pull/9814.diff","patch_url":"https://github.com/mono/mono/pull/9814.patch"},"body":" - Public headers should be wrapped in it (all but one are).\r\n - MONO_API should include it.\r\n\r\nBut it is not needed \"everywhere\".\r\n\r\nPlacement of \"extern\" therefore tweaked.\r\n  - Remove from functions where it is meaningless and gets in the way.\r\n  - Mark data with MONO_API_DATA instead of MONO_API.\r\n\r\n[not yet]Sprinkle in a few G_BEGIN_DECLS for monodis and where THREAD_INFO_TYPE makes prototypes incorrect.\r\n\r\ninclude/add prototypes for all icalls.\r\n\r\nThis has been seen to work.\r\n\r\nThe problem would be, if embedders manage to use functions that are neither MONO_API nor\r\nin public headers.\r\n\r\nSome parts of the larger solution are omited here in the hopes of finding better options.\r\nIn particular, compiling all of monodis as C++ so we don't need some extern \"C\" for it,\r\nand THREAD_INFO_TYPE at least incoming being gpointer so declaration and definition match.\r\n\r\nThis is based on https://github.com/mono/mono/pull/9812/commits/40315ee475bdf89c40189707a8cca86b3f6d91c8\r\nand is an alternative to https://github.com/mono/mono/pull/9782.\r\n\r\nDepending on how this goes, we should prune the preexisting G_BEGIN_DECLS / G_END_DECLS uses.\r\n\r\nAs master is not yet compilable as C++, fixes related to linking are perhaps premature.\r\nThis PR is partly about compiling but mostly linking.\r\nProvision of the icall prototypes is for compiling. If we don't care for typesafe linkage,\r\nor overloading, then sprinkling extern \"C\" everywhere is preferable. Larger but probably\r\nsimpler and preferable. This approach is more forward looking in that it provides type\r\nsafelinkage (\"name mangling\") and is compatible with overloads (you cannot overload\r\nin the face of extern \"C\"). PR 9782 is that alternative.\r\n\r\nThese approaches are not incompatible, but are redundant.\r\ni.e. you can declare the icalls correctly or not, and as extern \"C\" or not.\r\nYou can remove redundant `extern` even if erring toward extern \"C\", but it becomes\r\ncosmetic whereas here it is required or at least fixes many warnings.\r\n"},"comment":{"url":"https://api.github.com/repos/mono/mono/issues/comments/409377220","html_url":"https://github.com/mono/mono/pull/9814#issuecomment-409377220","issue_url":"https://api.github.com/repos/mono/mono/issues/9814","id":409377220,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTM3NzIyMA==","user":{"login":"jaykrell","id":1635728,"node_id":"MDQ6VXNlcjE2MzU3Mjg=","avatar_url":"https://avatars1.githubusercontent.com/u/1635728?v=4","gravatar_id":"","url":"https://api.github.com/users/jaykrell","html_url":"https://github.com/jaykrell","followers_url":"https://api.github.com/users/jaykrell/followers","following_url":"https://api.github.com/users/jaykrell/following{/other_user}","gists_url":"https://api.github.com/users/jaykrell/gists{/gist_id}","starred_url":"https://api.github.com/users/jaykrell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaykrell/subscriptions","organizations_url":"https://api.github.com/users/jaykrell/orgs","repos_url":"https://api.github.com/users/jaykrell/repos","events_url":"https://api.github.com/users/jaykrell/events{/privacy}","received_events_url":"https://api.github.com/users/jaykrell/received_events","type":"User","site_admin":false},"created_at":"2018-07-31T21:41:19Z","updated_at":"2018-07-31T21:41:19Z","author_association":"MEMBER","body":"There is some inconsistent formating in the `MONO_API MONO_RT_EXTERNAL_ONLY` stuff, as there was previously."}}
{"actor":{"display_login":"jaykrell"}}