{"action":"created","issue":{"url":"https://api.github.com/repos/cython/cython/issues/403","labels_url":"https://api.github.com/repos/cython/cython/issues/403/labels{/name}","comments_url":"https://api.github.com/repos/cython/cython/issues/403/comments","events_url":"https://api.github.com/repos/cython/cython/issues/403/events","html_url":"https://github.com/cython/cython/pull/403","id":91431845,"number":403,"title":"Rewrite __Pyx_sst_abs using only preprocessor macros, and add a case for 64-bit MSVC","user":{"login":"codewarrior0","id":307683,"avatar_url":"https://avatars.githubusercontent.com/u/307683?v=3","gravatar_id":"","url":"https://api.github.com/users/codewarrior0","html_url":"https://github.com/codewarrior0","followers_url":"https://api.github.com/users/codewarrior0/followers","following_url":"https://api.github.com/users/codewarrior0/following{/other_user}","gists_url":"https://api.github.com/users/codewarrior0/gists{/gist_id}","starred_url":"https://api.github.com/users/codewarrior0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codewarrior0/subscriptions","organizations_url":"https://api.github.com/users/codewarrior0/orgs","repos_url":"https://api.github.com/users/codewarrior0/repos","events_url":"https://api.github.com/users/codewarrior0/events{/privacy}","received_events_url":"https://api.github.com/users/codewarrior0/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-27T08:14:43Z","updated_at":"2015-06-28T08:27:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cython/cython/pulls/403","html_url":"https://github.com/cython/cython/pull/403","diff_url":"https://github.com/cython/cython/pull/403.diff","patch_url":"https://github.com/cython/cython/pull/403.patch"},"body":"Comparing `sizeof(Py_ssize_t)` to different sizes at compile time results in warnings or errors when the C++ compiler tries to find a function matching `abs(value)` (Per the standard library spec, no functions match if `ssize_t` is a typedef of `long long`). Luckily, `pyport.h` provides some SIZEOF macros we can use at preprocess time. __Pyx_sst_abs is now conditionally defined to a much shorter expression.\r\n\r\n64-bit MSVC is one case where `ssize_t` is a `long long`. Instead of falling back to `((value<0) ? -value : value))`, I added a check for 64-bit MSVC that calls the MS-specific function `_abs64(long long)`\r\n\r\nThis change also includes the change given by PR #402, improved with a check against the available C++ version as `std::abs` is only available on C++11.\r\n\r\nHave only tested this with 64-bit Python 2.7, 64-bit MSVC 2008. Let's see if Travis passes it."},"comment":{"url":"https://api.github.com/repos/cython/cython/issues/comments/116224995","html_url":"https://github.com/cython/cython/pull/403#issuecomment-116224995","issue_url":"https://api.github.com/repos/cython/cython/issues/403","id":116224995,"user":{"login":"scoder","id":491659,"avatar_url":"https://avatars.githubusercontent.com/u/491659?v=3","gravatar_id":"","url":"https://api.github.com/users/scoder","html_url":"https://github.com/scoder","followers_url":"https://api.github.com/users/scoder/followers","following_url":"https://api.github.com/users/scoder/following{/other_user}","gists_url":"https://api.github.com/users/scoder/gists{/gist_id}","starred_url":"https://api.github.com/users/scoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scoder/subscriptions","organizations_url":"https://api.github.com/users/scoder/orgs","repos_url":"https://api.github.com/users/scoder/repos","events_url":"https://api.github.com/users/scoder/events{/privacy}","received_events_url":"https://api.github.com/users/scoder/received_events","type":"User","site_admin":false},"created_at":"2015-06-28T08:27:04Z","updated_at":"2015-06-28T08:27:04Z","body":"Thanks!"}}