{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/folly/pulls/comments/34231663","id":34231663,"diff_hunk":"@@ -53,4 +53,725 @@\n # define FOLLY_DISABLE_ADDRESS_SANITIZER\n #endif\n \n+\n+#ifdef _MSC_VER\n+#include <sys/stat.h>\n+#define S_IXUSR 0\n+#define S_IWUSR _S_IWRITE\n+#define S_IRUSR _S_IREAD\n+\n+#define S_IXGRP S_IXUSR\n+#define S_IWGRP S_IWUSR\n+#define S_IRGRP S_IRUSR\n+#define S_IXOTH S_IXUSR\n+#define S_IWOTH S_IWUSR\n+#define S_IROTH S_IRUSR\n+#endif\n+\n+\n+#ifdef _MSC_VER\n+\n+#ifndef __STDC__\n+#define __STDC__ 1\n+#include <io.h>\n+#undef __STDC__\n+#else\n+#include <io.h>\n+#endif\n+\n+#include <assert.h>\n+#include <direct.h>\n+#include <intrin.h>\n+#include <malloc.h>\n+#include <math.h>\n+#include <signal.h>\n+#include <stdarg.h>\n+#include <stdio.h>\n+#include <stdint.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#include <time.h>\n+#include <Windows.h>\n+#include <WinSock2.h>\n+\n+#include <pthread.h>\n+#include <pthread_clock.h>\n+\n+\n+// Do nothing for the system log for now.\n+inline void openlog(const char*, int, int) {}\n+inline void closelog() {}\n+inline void syslog(int, const char*, ...) {}\n+\n+#define SIGCHLD 0\n+// We use SIGILL as SIGALRM, as SIGILL is\n+// never generated by windows.\n+#define SIGALRM SIGILL\n+// All 4 of these are invalid signal IDs.\n+#define SIGVTALRM 26\n+#define SIGPROF 27\n+#define SIGKILL 28\n+#define SIGUSR1 29\n+\n+inline void __stdcall __alarm_callback_func(HWND, UINT, UINT_PTR, DWORD) {\n+  raise(SIGALRM);\n+}\n+\n+inline unsigned int alarm(unsigned int seconds) {\n+  SetTimer(NULL, 0, (UINT)(seconds * 1000), __alarm_callback_func);\n+  return 0;\n+}\n+\n+inline char* asctime_r(const tm* tm, char* buf) {\n+  char tmpBuf[64];\n+  if (asctime_s(tmpBuf, sizeof(tmpBuf), tm))\n+    return NULL;\n+  return strcpy(buf, tmpBuf);\n+}\n+\n+inline void bzero(void* s, size_t n) {\n+  ZeroMemory(s, n);\n+}\n+\n+#define DT_UNKNOWN 0\n+#define DT_DIR     1\n+#define DT_REG     2\n+#define DT_LNK     3\n+struct dirent {\n+  unsigned char d_type;\n+  char* d_name;\n+};\n+\n+struct DIR {\n+  dirent dir;\n+  HANDLE hand;\n+  int cnt;\n+  char name[MAX_PATH * 3];\n+};\n+\n+inline int closedir(DIR* dir) {","path":"folly/CPortability.h","position":108,"original_position":100,"commit_id":"57c12da941fe4f6708c484e43d61a9620f1fa25b","original_commit_id":"cc4462f4fc5d88b26d41f501bb751e5d7c4c6c21","user":{"login":"ariccio","id":2142308,"avatar_url":"https://avatars.githubusercontent.com/u/2142308?v=3","gravatar_id":"","url":"https://api.github.com/users/ariccio","html_url":"https://github.com/ariccio","followers_url":"https://api.github.com/users/ariccio/followers","following_url":"https://api.github.com/users/ariccio/following{/other_user}","gists_url":"https://api.github.com/users/ariccio/gists{/gist_id}","starred_url":"https://api.github.com/users/ariccio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ariccio/subscriptions","organizations_url":"https://api.github.com/users/ariccio/orgs","repos_url":"https://api.github.com/users/ariccio/repos","events_url":"https://api.github.com/users/ariccio/events{/privacy}","received_events_url":"https://api.github.com/users/ariccio/received_events","type":"User","site_admin":false},"body":"Fair enough.","created_at":"2015-07-09T08:03:06Z","updated_at":"2015-07-09T08:03:06Z","html_url":"https://github.com/facebook/folly/pull/235#discussion_r34231663","pull_request_url":"https://api.github.com/repos/facebook/folly/pulls/235","_links":{"self":{"href":"https://api.github.com/repos/facebook/folly/pulls/comments/34231663"},"html":{"href":"https://github.com/facebook/folly/pull/235#discussion_r34231663"},"pull_request":{"href":"https://api.github.com/repos/facebook/folly/pulls/235"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/folly/pulls/235","id":39239068,"html_url":"https://github.com/facebook/folly/pull/235","diff_url":"https://github.com/facebook/folly/pull/235.diff","patch_url":"https://github.com/facebook/folly/pull/235.patch","issue_url":"https://api.github.com/repos/facebook/folly/issues/235","number":235,"state":"open","locked":false,"title":"Port Folly to MSVC 2015 RC","user":{"login":"Orvid","id":709247,"avatar_url":"https://avatars.githubusercontent.com/u/709247?v=3","gravatar_id":"","url":"https://api.github.com/users/Orvid","html_url":"https://github.com/Orvid","followers_url":"https://api.github.com/users/Orvid/followers","following_url":"https://api.github.com/users/Orvid/following{/other_user}","gists_url":"https://api.github.com/users/Orvid/gists{/gist_id}","starred_url":"https://api.github.com/users/Orvid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Orvid/subscriptions","organizations_url":"https://api.github.com/users/Orvid/orgs","repos_url":"https://api.github.com/users/Orvid/repos","events_url":"https://api.github.com/users/Orvid/events{/privacy}","received_events_url":"https://api.github.com/users/Orvid/received_events","type":"User","site_admin":false},"body":"This is the foundation of my work in progress port of HHVM to Windows. Once this is in, and HHVM's third-party repo is updated, I can begin to submit PRs porting pieces of HHVM to windows.\r\n\r\nThis ignores most of the wangle directory, and anything excluded by the HHVM CMake file.\r\nThere are various temporary hacks in place, cordoned off by #ifdef's of #defines that are defined in Portability.h, which will need to be either removed or reviewed once VS2015 RTM is released.\r\n","created_at":"2015-07-06T06:29:04Z","updated_at":"2015-07-09T08:03:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d9e40bc3e1951fc51560b77f600505846a59933","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/folly/pulls/235/commits","review_comments_url":"https://api.github.com/repos/facebook/folly/pulls/235/comments","review_comment_url":"https://api.github.com/repos/facebook/folly/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/folly/issues/235/comments","statuses_url":"https://api.github.com/repos/facebook/folly/statuses/57c12da941fe4f6708c484e43d61a9620f1fa25b","head":{"label":"Orvid:msvc-port","ref":"msvc-port","sha":"57c12da941fe4f6708c484e43d61a9620f1fa25b","user":{"login":"Orvid","id":709247,"avatar_url":"https://avatars.githubusercontent.com/u/709247?v=3","gravatar_id":"","url":"https://api.github.com/users/Orvid","html_url":"https://github.com/Orvid","followers_url":"https://api.github.com/users/Orvid/followers","following_url":"https://api.github.com/users/Orvid/following{/other_user}","gists_url":"https://api.github.com/users/Orvid/gists{/gist_id}","starred_url":"https://api.github.com/users/Orvid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Orvid/subscriptions","organizations_url":"https://api.github.com/users/Orvid/orgs","repos_url":"https://api.github.com/users/Orvid/repos","events_url":"https://api.github.com/users/Orvid/events{/privacy}","received_events_url":"https://api.github.com/users/Orvid/received_events","type":"User","site_admin":false},"repo":{"id":36701771,"name":"folly","full_name":"Orvid/folly","owner":{"login":"Orvid","id":709247,"avatar_url":"https://avatars.githubusercontent.com/u/709247?v=3","gravatar_id":"","url":"https://api.github.com/users/Orvid","html_url":"https://github.com/Orvid","followers_url":"https://api.github.com/users/Orvid/followers","following_url":"https://api.github.com/users/Orvid/following{/other_user}","gists_url":"https://api.github.com/users/Orvid/gists{/gist_id}","starred_url":"https://api.github.com/users/Orvid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Orvid/subscriptions","organizations_url":"https://api.github.com/users/Orvid/orgs","repos_url":"https://api.github.com/users/Orvid/repos","events_url":"https://api.github.com/users/Orvid/events{/privacy}","received_events_url":"https://api.github.com/users/Orvid/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Orvid/folly","description":"An open-source C++ library developed and used at Facebook.","fork":true,"url":"https://api.github.com/repos/Orvid/folly","forks_url":"https://api.github.com/repos/Orvid/folly/forks","keys_url":"https://api.github.com/repos/Orvid/folly/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Orvid/folly/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Orvid/folly/teams","hooks_url":"https://api.github.com/repos/Orvid/folly/hooks","issue_events_url":"https://api.github.com/repos/Orvid/folly/issues/events{/number}","events_url":"https://api.github.com/repos/Orvid/folly/events","assignees_url":"https://api.github.com/repos/Orvid/folly/assignees{/user}","branches_url":"https://api.github.com/repos/Orvid/folly/branches{/branch}","tags_url":"https://api.github.com/repos/Orvid/folly/tags","blobs_url":"https://api.github.com/repos/Orvid/folly/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Orvid/folly/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Orvid/folly/git/refs{/sha}","trees_url":"https://api.github.com/repos/Orvid/folly/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Orvid/folly/statuses/{sha}","languages_url":"https://api.github.com/repos/Orvid/folly/languages","stargazers_url":"https://api.github.com/repos/Orvid/folly/stargazers","contributors_url":"https://api.github.com/repos/Orvid/folly/contributors","subscribers_url":"https://api.github.com/repos/Orvid/folly/subscribers","subscription_url":"https://api.github.com/repos/Orvid/folly/subscription","commits_url":"https://api.github.com/repos/Orvid/folly/commits{/sha}","git_commits_url":"https://api.github.com/repos/Orvid/folly/git/commits{/sha}","comments_url":"https://api.github.com/repos/Orvid/folly/comments{/number}","issue_comment_url":"https://api.github.com/repos/Orvid/folly/issues/comments{/number}","contents_url":"https://api.github.com/repos/Orvid/folly/contents/{+path}","compare_url":"https://api.github.com/repos/Orvid/folly/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Orvid/folly/merges","archive_url":"https://api.github.com/repos/Orvid/folly/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Orvid/folly/downloads","issues_url":"https://api.github.com/repos/Orvid/folly/issues{/number}","pulls_url":"https://api.github.com/repos/Orvid/folly/pulls{/number}","milestones_url":"https://api.github.com/repos/Orvid/folly/milestones{/number}","notifications_url":"https://api.github.com/repos/Orvid/folly/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Orvid/folly/labels{/name}","releases_url":"https://api.github.com/repos/Orvid/folly/releases{/id}","created_at":"2015-06-02T02:10:56Z","updated_at":"2015-06-02T02:10:59Z","pushed_at":"2015-07-09T02:56:46Z","git_url":"git://github.com/Orvid/folly.git","ssh_url":"git@github.com:Orvid/folly.git","clone_url":"https://github.com/Orvid/folly.git","svn_url":"https://github.com/Orvid/folly","homepage":"https://groups.google.com/forum/?fromgroups#!forum/facebook-folly","size":6874,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"28f7b88becd3c26e941916b87e0b616e2dd6edd6","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":4524181,"name":"folly","full_name":"facebook/folly","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/folly","description":"An open-source C++ library developed and used at Facebook.","fork":false,"url":"https://api.github.com/repos/facebook/folly","forks_url":"https://api.github.com/repos/facebook/folly/forks","keys_url":"https://api.github.com/repos/facebook/folly/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/folly/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/folly/teams","hooks_url":"https://api.github.com/repos/facebook/folly/hooks","issue_events_url":"https://api.github.com/repos/facebook/folly/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/folly/events","assignees_url":"https://api.github.com/repos/facebook/folly/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/folly/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/folly/tags","blobs_url":"https://api.github.com/repos/facebook/folly/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/folly/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/folly/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/folly/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/folly/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/folly/languages","stargazers_url":"https://api.github.com/repos/facebook/folly/stargazers","contributors_url":"https://api.github.com/repos/facebook/folly/contributors","subscribers_url":"https://api.github.com/repos/facebook/folly/subscribers","subscription_url":"https://api.github.com/repos/facebook/folly/subscription","commits_url":"https://api.github.com/repos/facebook/folly/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/folly/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/folly/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/folly/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/folly/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/folly/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/folly/merges","archive_url":"https://api.github.com/repos/facebook/folly/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/folly/downloads","issues_url":"https://api.github.com/repos/facebook/folly/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/folly/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/folly/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/folly/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/folly/labels{/name}","releases_url":"https://api.github.com/repos/facebook/folly/releases{/id}","created_at":"2012-06-01T20:49:04Z","updated_at":"2015-07-08T06:14:39Z","pushed_at":"2015-07-09T02:56:48Z","git_url":"git://github.com/facebook/folly.git","ssh_url":"git@github.com:facebook/folly.git","clone_url":"https://github.com/facebook/folly.git","svn_url":"https://github.com/facebook/folly","homepage":"https://groups.google.com/forum/?fromgroups#!forum/facebook-folly","size":9323,"stargazers_count":5018,"watchers_count":5018,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1081,"mirror_url":null,"open_issues_count":18,"forks":1081,"open_issues":18,"watchers":5018,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/folly/pulls/235"},"html":{"href":"https://github.com/facebook/folly/pull/235"},"issue":{"href":"https://api.github.com/repos/facebook/folly/issues/235"},"comments":{"href":"https://api.github.com/repos/facebook/folly/issues/235/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/folly/pulls/235/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/folly/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/folly/pulls/235/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/folly/statuses/57c12da941fe4f6708c484e43d61a9620f1fa25b"}}}}