{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/folly/issues/76","labels_url":"https://api.github.com/repos/facebook/folly/issues/76/labels{/name}","comments_url":"https://api.github.com/repos/facebook/folly/issues/76/comments","events_url":"https://api.github.com/repos/facebook/folly/issues/76/events","html_url":"https://github.com/facebook/folly/issues/76","id":38399907,"number":76,"title":"Bits.h in MSVC","user":{"login":"ichenq","id":238406,"avatar_url":"https://avatars.githubusercontent.com/u/238406?v=3","gravatar_id":"","url":"https://api.github.com/users/ichenq","html_url":"https://github.com/ichenq","followers_url":"https://api.github.com/users/ichenq/followers","following_url":"https://api.github.com/users/ichenq/following{/other_user}","gists_url":"https://api.github.com/users/ichenq/gists{/gist_id}","starred_url":"https://api.github.com/users/ichenq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ichenq/subscriptions","organizations_url":"https://api.github.com/users/ichenq/orgs","repos_url":"https://api.github.com/users/ichenq/repos","events_url":"https://api.github.com/users/ichenq/events{/privacy}","received_events_url":"https://api.github.com/users/ichenq/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-07-22T13:33:45Z","updated_at":"2015-04-07T18:31:11Z","closed_at":null,"body":"It seems the effort to port Bits.h to MSVC have a little bit problem:\r\n__builtin_ffs(x) won't return 0 when x is not 0, but _BitScanForward(index, mask) can load index to zero when mask's LSB is 1.\r\n\r\nI make this:\r\n`````````````````````cpp\r\n#ifdef _MSC_VER\r\n    unsigned long index;\r\n    return (_BitScanForward(&index, x) ? index + 1 : 0);\r\n#else\r\n    return __builtin_ffs(x);\r\n#endif\r\n````````````````````"},"comment":{"url":"https://api.github.com/repos/facebook/folly/issues/comments/90691325","html_url":"https://github.com/facebook/folly/issues/76#issuecomment-90691325","issue_url":"https://api.github.com/repos/facebook/folly/issues/76","id":90691325,"user":{"login":"facebook-github-bot-5","id":8398657,"avatar_url":"https://avatars.githubusercontent.com/u/8398657?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook-github-bot-5","html_url":"https://github.com/facebook-github-bot-5","followers_url":"https://api.github.com/users/facebook-github-bot-5/followers","following_url":"https://api.github.com/users/facebook-github-bot-5/following{/other_user}","gists_url":"https://api.github.com/users/facebook-github-bot-5/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook-github-bot-5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook-github-bot-5/subscriptions","organizations_url":"https://api.github.com/users/facebook-github-bot-5/orgs","repos_url":"https://api.github.com/users/facebook-github-bot-5/repos","events_url":"https://api.github.com/users/facebook-github-bot-5/events{/privacy}","received_events_url":"https://api.github.com/users/facebook-github-bot-5/received_events","type":"User","site_admin":false},"created_at":"2015-04-07T18:31:11Z","updated_at":"2015-04-07T18:31:11Z","body":"Thank you for reporting this issue and appreciate your patience. We've  notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed."}}