Commit 517a214b authored by Jason Madden's avatar Jason Madden

Attempt to workaround Visual C 9.0 for CPython 2.7 on windows missing...

Attempt to workaround Visual C 9.0 for CPython 2.7 on windows missing stdint.h. Also correct a compiler warning.
parent 4f7d3298
# From cython/includes/libc/stdint.pxd # From cython/includes/libc/stdint.pxd
# Longness only used for type promotion. # Longness only used for type promotion.
# Actual compile time size used for conversions. # Actual compile time size used for conversions.
# We don't have stdint.h on visual studio 9.0 (2008) on windows, sigh,
# 7.18 Integer types <stdint.h> # so go with Py_ssize_t
cdef extern from "<stdint.h>" nogil: # ssize_t -> intptr_t
# 7.18.1.4 Integer types capable of holding object pointers
ctypedef ssize_t intptr_t
cdef extern from "libev_vfd.h": cdef extern from "libev_vfd.h":
# cython doesn't process pre-processor directives, so they # cython doesn't process pre-processor directives, so they
# don't matter in this file. It just takes the last definition it sees. # don't matter in this file. It just takes the last definition it sees.
ctypedef Py_ssize_t intptr_t
ctypedef intptr_t vfd_socket_t ctypedef intptr_t vfd_socket_t
long vfd_get(int) vfd_socket_t vfd_get(int)
int vfd_open(long) except -1 int vfd_open(long) except -1
void vfd_free(int) void vfd_free(int)
......
...@@ -68,7 +68,7 @@ static CRITICAL_SECTION* vfd_make_lock() ...@@ -68,7 +68,7 @@ static CRITICAL_SECTION* vfd_make_lock()
*/ */
static vfd_socket_t vfd_get(int fd) static vfd_socket_t vfd_get(int fd)
{ {
int handle = -1; vfd_socket_t handle = -1;
VFD_LOCK_ENTER; VFD_LOCK_ENTER;
if (vfd_entries != NULL && fd >= 0 && fd < vfd_num) if (vfd_entries != NULL && fd >= 0 && fd < vfd_num)
handle = vfd_entries[fd].handle; handle = vfd_entries[fd].handle;
...@@ -220,6 +220,6 @@ done: ...@@ -220,6 +220,6 @@ done:
*/ */
typedef int vfd_socket_t; typedef int vfd_socket_t;
#define vfd_get(fd) (fd) #define vfd_get(fd) (fd)
#define vfd_open(fd) ((int)(fd)) #define vfd_open(fd) (fd)
#define vfd_free(fd) #define vfd_free(fd)
#endif /* _WIN32 */ #endif /* _WIN32 */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment