Skip to content

Commit

Permalink
Fixes for macOS and Win.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Dec 15, 2021
1 parent 7cff250 commit 0ef2ba8
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 52 deletions.
26 changes: 0 additions & 26 deletions deps/cares-win32.patch

This file was deleted.

24 changes: 0 additions & 24 deletions deps/libuv-1.38-static-assert.patch

This file was deleted.

27 changes: 27 additions & 0 deletions deps/libuv-1.42-py27-win.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/deps/libuv/src/win/util.c b/deps/libuv/src/win/util.c
index 88602c7e..d6009ce3 100644
--- a/deps/libuv/src/win/util.c
+++ b/deps/libuv/src/win/util.c
@@ -1662,7 +1662,13 @@ int uv_os_unsetenv(const char* name) {
return 0;
}

-
+/**
+ * gevent: disable this function for Python 2.7 on Windows.
+ *
+ * It fails to link on anything older than Windows 8/Windows Server 2012
+ * because of GetHostNameW.
+ */
+#if 0
int uv_os_gethostname(char* buffer, size_t* size) {
WCHAR buf[UV_MAXHOSTNAMESIZE];
size_t len;
@@ -1694,6 +1700,7 @@ int uv_os_gethostname(char* buffer, size_t* size) {
*size = len;
return 0;
}
+#endif


static int uv__get_handle(uv_pid_t pid, int access, HANDLE* handle) {
9 changes: 8 additions & 1 deletion deps/libuv/src/win/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1662,7 +1662,13 @@ int uv_os_unsetenv(const char* name) {
return 0;
}


/**
* gevent: disable this function for Python 2.7 on Windows.
*
* It fails to link on anything older than Windows 8/Windows Server 2012
* because of GetHostNameW.
*/
#if 0
int uv_os_gethostname(char* buffer, size_t* size) {
WCHAR buf[UV_MAXHOSTNAMESIZE];
size_t len;
Expand Down Expand Up @@ -1694,6 +1700,7 @@ int uv_os_gethostname(char* buffer, size_t* size) {
*size = len;
return 0;
}
#endif


static int uv__get_handle(uv_pid_t pid, int access, HANDLE* handle) {
Expand Down
2 changes: 1 addition & 1 deletion src/gevent/libuv/_corecffi_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ def _libuv_source(rel_path):
_libuv_source('unix/thread.c'),
_libuv_source('unix/tty.c'),
_libuv_source('unix/udp.c'),
_libuv_source('unix/epoll.c'),
]


Expand All @@ -163,6 +162,7 @@ def _libuv_source(rel_path):
_libuv_source('unix/procfs-exepath.c'),
_libuv_source('unix/proctitle.c'),
_libuv_source('unix/random-sysctl-linux.c'),
_libuv_source('unix/epoll.c'),
]
elif sys.platform == 'darwin':
LIBUV_SOURCES += [
Expand Down

0 comments on commit 0ef2ba8

Please sign in to comment.