mirror of https://github.com/MagicStack/uvloop.git
Support libuv < v1.9.0
This commit is contained in:
parent
2e8947fc25
commit
6726a50b1a
|
@ -1,6 +1,6 @@
|
|||
recursive-include examples *.py
|
||||
recursive-include tests *.py *.pem
|
||||
recursive-include uvloop *.pyx *.pxd *.pxi *.py
|
||||
recursive-include uvloop *.pyx *.pxd *.pxi *.py *.c *.h
|
||||
recursive-include vendor/libuv *
|
||||
recursive-exclude vendor/libuv/.git *
|
||||
recursive-exclude vendor/libuv/docs *
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
#include "uv.h"
|
||||
|
||||
|
||||
// uv_poll_event.UV_DISCONNECT is available since libuv v1.9.0
|
||||
#if UV_VERSION_HEX < 0x10900
|
||||
#define UV_DISCONNECT 0
|
||||
#endif
|
|
@ -4,6 +4,12 @@ from posix.types cimport gid_t, uid_t
|
|||
from . cimport system
|
||||
|
||||
|
||||
cdef extern from "includes/compat.h":
|
||||
# Member of uv_poll_event, in compat.h for compatibility
|
||||
# with libuv < v1.9.0
|
||||
cdef int UV_DISCONNECT
|
||||
|
||||
|
||||
cdef extern from "uv.h" nogil:
|
||||
cdef int UV_EACCES
|
||||
cdef int UV_EAGAIN
|
||||
|
@ -183,8 +189,8 @@ cdef extern from "uv.h" nogil:
|
|||
|
||||
ctypedef enum uv_poll_event:
|
||||
UV_READABLE = 1,
|
||||
UV_WRITABLE = 2,
|
||||
UV_DISCONNECT = 4
|
||||
UV_WRITABLE = 2
|
||||
# UV_DISCONNECT = 4 ; see compat.h for details
|
||||
|
||||
ctypedef enum uv_udp_flags:
|
||||
UV_UDP_IPV6ONLY = 1,
|
||||
|
|
|
@ -43,7 +43,6 @@ cdef Loop __main_loop__ = None
|
|||
cdef class Loop:
|
||||
def __cinit__(self):
|
||||
cdef int err
|
||||
|
||||
# Install PyMem* memory allocators if they aren't installed yet.
|
||||
__install_pymem()
|
||||
|
||||
|
|
Loading…
Reference in New Issue