Title: A patch to build with Visual Studio 2015 · Issue #161 · python-cmake-buildsystem/python-cmake-buildsystem · GitHub
Open Graph Title: A patch to build with Visual Studio 2015 · Issue #161 · python-cmake-buildsystem/python-cmake-buildsystem
X Title: A patch to build with Visual Studio 2015 · Issue #161 · python-cmake-buildsystem/python-cmake-buildsystem
Description: This is a patch to make Python 2.7.11 build on VS2015: From 4ab220c38c7d15192ed3b394f47e4196c947f056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?=
Open Graph Description: This is a patch to make Python 2.7.11 build on VS2015: From 4ab220c38c7d15192ed3b394f47e4196c947f056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?=
X Description: This is a patch to make Python 2.7.11 build on VS2015: From 4ab220c38c7d15192ed3b394f47e4196c947f056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= <dzenan.zukic@kitware.com...
Opengraph URL: https://github.com/python-cmake-buildsystem/python-cmake-buildsystem/issues/161
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"A patch to build with Visual Studio 2015","articleBody":"This is a patch to make Python 2.7.11 build on VS2015:\n\n```\nFrom 4ab220c38c7d15192ed3b394f47e4196c947f056 Mon Sep 17 00:00:00 2001\nFrom: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= \u003cdzenan.zukic@kitware.com\u003e\nDate: Mon, 24 Oct 2016 09:13:30 -0400\nSubject: [PATCH] Build with VS2015\n\n---\n Modules/posixmodule.c | 36 +++++-------------------------------\n Modules/timemodule.c | 8 ++++----\n 2 files changed, 9 insertions(+), 35 deletions(-)\n\ndiff --git a/Modules/posixmodule.c b/Modules/posixmodule.c\nindex 4fc3ef7..d90953f 100644\n--- a/Modules/posixmodule.c\n+++ b/Modules/posixmodule.c\n@@ -570,38 +570,12 @@ extern __declspec(dllimport) char * __pioinfo[];\n int\n _PyVerify_fd(int fd)\n {\n- const int i1 = fd \u003e\u003e IOINFO_L2E;\n- const int i2 = fd \u0026 ((1 \u003c\u003c IOINFO_L2E) - 1);\n\n- static int sizeof_ioinfo = 0;\n-\n- /* Determine the actual size of the ioinfo structure,\n- * as used by the CRT loaded in memory\n- */\n- if (sizeof_ioinfo == 0 \u0026\u0026 __pioinfo[0] != NULL) {\n- sizeof_ioinfo = _msize(__pioinfo[0]) / IOINFO_ARRAY_ELTS;\n- }\n- if (sizeof_ioinfo == 0) {\n- /* This should not happen... */\n- goto fail;\n- }\n-\n- /* See that it isn't a special CLEAR fileno */\n- if (fd != _NO_CONSOLE_FILENO) {\n- /* Microsoft CRT would check that 0\u003c=fd\u003c_nhandle but we can't do that. Instead\n- * we check pointer validity and other info\n- */\n- if (0 \u003c= i1 \u0026\u0026 i1 \u003c IOINFO_ARRAYS \u0026\u0026 __pioinfo[i1] != NULL) {\n- /* finally, check that the file is open */\n- my_ioinfo* info = (my_ioinfo*)(__pioinfo[i1] + i2 * sizeof_ioinfo);\n- if (info-\u003eosfile \u0026 FOPEN) {\n- return 1;\n- }\n- }\n- }\n- fail:\n- errno = EBADF;\n- return 0;\n+ //a call to _get_osfhandle with invalid fd sets errno to EBADF\n+ if (_get_osfhandle(fd) == INVALID_HANDLE_VALUE)\n+ return 0;\n+ else\n+ return 1;\n }\n\n /* the special case of checking dup2. The target fd must be in a sensible range */\ndiff --git a/Modules/timemodule.c b/Modules/timemodule.c\nindex 12c43b0..8692080 100644\n--- a/Modules/timemodule.c\n+++ b/Modules/timemodule.c\n@@ -710,7 +710,7 @@ inittimezone(PyObject *m) {\n #ifdef PYOS_OS2\n PyModule_AddIntConstant(m, \"timezone\", _timezone);\n #else /* !PYOS_OS2 */\n- PyModule_AddIntConstant(m, \"timezone\", timezone);\n+ PyModule_AddIntConstant(m, \"timezone\", _timezone);\n #endif /* PYOS_OS2 */\n #ifdef HAVE_ALTZONE\n PyModule_AddIntConstant(m, \"altzone\", altzone);\n@@ -718,12 +718,12 @@ inittimezone(PyObject *m) {\n #ifdef PYOS_OS2\n PyModule_AddIntConstant(m, \"altzone\", _timezone-3600);\n #else /* !PYOS_OS2 */\n- PyModule_AddIntConstant(m, \"altzone\", timezone-3600);\n+ PyModule_AddIntConstant(m, \"altzone\", _timezone-3600);\n #endif /* PYOS_OS2 */\n #endif\n- PyModule_AddIntConstant(m, \"daylight\", daylight);\n+ PyModule_AddIntConstant(m, \"daylight\", _daylight);\n PyModule_AddObject(m, \"tzname\",\n- Py_BuildValue(\"(zz)\", tzname[0], tzname[1]));\n+ Py_BuildValue(\"(zz)\", _tzname[0], _tzname[1]));\n #else /* !HAVE_TZNAME || __GLIBC__ || __CYGWIN__*/\n #ifdef HAVE_STRUCT_TM_TM_ZONE\n {\n-- \n2.9.0.windows.1\n```\n","author":{"url":"https://github.com/dzenanz","@type":"Person","name":"dzenanz"},"datePublished":"2016-10-24T13:19:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":18},"url":"https://github.com/161/python-cmake-buildsystem/issues/161"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:070abcce-88da-934c-d242-6f3f26b674c7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ED3A:7E35F:946370:D4591E:6A58C7A8 |
| html-safe-nonce | 492cd63e4d550c4488c76b643c8204458074e3423f6e4fec77a6f134abf4b190 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDNBOjdFMzVGOjk0NjM3MDpENDU5MUU6NkE1OEM3QTgiLCJ2aXNpdG9yX2lkIjoiNzA2Nzc2MzQ3MjE1NjExNjkwNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4a9c047d3b55ed95ce637f2de13e9f582716e24c000dcfeb3d1fef55ab30c8ab |
| hovercard-subject-tag | issue:184838278 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-cmake-buildsystem/python-cmake-buildsystem/161/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5d905417e7ddb6fecafc0f228c506d8cc688961e9eac1be562adddbb095bb500/python-cmake-buildsystem/python-cmake-buildsystem/issues/161 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5d905417e7ddb6fecafc0f228c506d8cc688961e9eac1be562adddbb095bb500/python-cmake-buildsystem/python-cmake-buildsystem/issues/161 |
| og:image:alt | This is a patch to make Python 2.7.11 build on VS2015: From 4ab220c38c7d15192ed3b394f47e4196c947f056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dzenanz |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f2a0c7865178af3d91dd9f13b0cdfc3c73a2529c873d2780bb4c01271a57ec6 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-cmake-buildsystem/python-cmake-buildsystem git https://github.com/python-cmake-buildsystem/python-cmake-buildsystem.git |
| octolytics-dimension-user_id | 13651879 |
| octolytics-dimension-user_login | python-cmake-buildsystem |
| octolytics-dimension-repository_id | 1304677 |
| octolytics-dimension-repository_nwo | python-cmake-buildsystem/python-cmake-buildsystem |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1304677 |
| octolytics-dimension-repository_network_root_nwo | python-cmake-buildsystem/python-cmake-buildsystem |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8aae7b8d6caacacf5c66eaeb2702d8dc88d85b4a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width