{"action":"created","issue":{"url":"https://api.github.com/repos/VioletGiraffe/file-commander/issues/63","labels_url":"https://api.github.com/repos/VioletGiraffe/file-commander/issues/63/labels{/name}","comments_url":"https://api.github.com/repos/VioletGiraffe/file-commander/issues/63/comments","events_url":"https://api.github.com/repos/VioletGiraffe/file-commander/issues/63/events","html_url":"https://github.com/VioletGiraffe/file-commander/pull/63","id":91202648,"number":63,"title":"fix include dependencies","user":{"login":"antis81","id":440517,"avatar_url":"https://avatars.githubusercontent.com/u/440517?v=3","gravatar_id":"","url":"https://api.github.com/users/antis81","html_url":"https://github.com/antis81","followers_url":"https://api.github.com/users/antis81/followers","following_url":"https://api.github.com/users/antis81/following{/other_user}","gists_url":"https://api.github.com/users/antis81/gists{/gist_id}","starred_url":"https://api.github.com/users/antis81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antis81/subscriptions","organizations_url":"https://api.github.com/users/antis81/orgs","repos_url":"https://api.github.com/users/antis81/repos","events_url":"https://api.github.com/users/antis81/events{/privacy}","received_events_url":"https://api.github.com/users/antis81/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-06-26T09:25:06Z","updated_at":"2015-06-26T17:45:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/VioletGiraffe/file-commander/pulls/63","html_url":"https://github.com/VioletGiraffe/file-commander/pull/63","diff_url":"https://github.com/VioletGiraffe/file-commander/pull/63.diff","patch_url":"https://github.com/VioletGiraffe/file-commander/pull/63.patch"},"body":"Minimizing the include dependencies in main app."},"comment":{"url":"https://api.github.com/repos/VioletGiraffe/file-commander/issues/comments/115808004","html_url":"https://github.com/VioletGiraffe/file-commander/pull/63#issuecomment-115808004","issue_url":"https://api.github.com/repos/VioletGiraffe/file-commander/issues/63","id":115808004,"user":{"login":"VioletGiraffe","id":1175926,"avatar_url":"https://avatars.githubusercontent.com/u/1175926?v=3","gravatar_id":"","url":"https://api.github.com/users/VioletGiraffe","html_url":"https://github.com/VioletGiraffe","followers_url":"https://api.github.com/users/VioletGiraffe/followers","following_url":"https://api.github.com/users/VioletGiraffe/following{/other_user}","gists_url":"https://api.github.com/users/VioletGiraffe/gists{/gist_id}","starred_url":"https://api.github.com/users/VioletGiraffe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VioletGiraffe/subscriptions","organizations_url":"https://api.github.com/users/VioletGiraffe/orgs","repos_url":"https://api.github.com/users/VioletGiraffe/repos","events_url":"https://api.github.com/users/VioletGiraffe/events{/privacy}","received_events_url":"https://api.github.com/users/VioletGiraffe/received_events","type":"User","site_admin":false},"created_at":"2015-06-26T17:45:47Z","updated_at":"2015-06-26T17:45:47Z","body":">There's something wrong with the c++11 switches (the \"override\" warning)\r\n\r\nMaybe that is the only problem on Linux with clang. But take a look at the list of warnings on Windows (MSVC 2013): https://gist.github.com/VioletGiraffe/755cdb87fd3c4b95f5bb\r\n\r\n>What I mean is, that you don't want those #ifdef's in your code \r\nEither way, I do need platform-specific code, so the question is how to implement it. I can think of 3 different methods:\r\n1. `#ifdef` (conditional compilation)\r\n2. isolating the method(s) of the class that need different behavior on different systems and implementing them in different .cpp files: `classname_win.cpp`, `classname_osx.cpp` etc. (conditional project generation).\r\n3. Making those methods `virtual` and creating a base class (if applicable) and a specific class for each platform (polymorphism, late binding). And you probably still need `#ifdef` to instantiate the right class :P\r\n\r\nI think it boils down to personal preference, but method 1 often allows to achieve as little code duplication as possible - less than with methods 2. and 3. As a rule of thumb, I prefer `#ifdef` when the platform-specific code is very short, *or* when it's not very long and `#ifdef` does allow for less code duplication. Otherwise, I prefer method 2."}}