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
# Longness only used for type promotion.
# Actual compile time size used for conversions.
# 7.18 Integer types <stdint.h>
cdef extern from "<stdint.h>" nogil:
# 7.18.1.4 Integer types capable of holding object pointers
ctypedef ssize_t intptr_t
# Longness only used for type promotion.
# Actual compile time size used for conversions.
# We don't have stdint.h on visual studio 9.0 (2008) on windows, sigh,
# so go with Py_ssize_t
# ssize_t -> intptr_t
cdef extern from "libev_vfd.h":
# cython doesn't process pre-processor directives, so they
# 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
long vfd_get(int)
vfd_socket_t vfd_get(int)
int vfd_open(long) except -1
void vfd_free(int)
......
......@@ -68,7 +68,7 @@ static CRITICAL_SECTION* vfd_make_lock()
*/
static vfd_socket_t vfd_get(int fd)
{
int handle = -1;
vfd_socket_t handle = -1;
VFD_LOCK_ENTER;
if (vfd_entries != NULL && fd >= 0 && fd < vfd_num)
handle = vfd_entries[fd].handle;
......@@ -220,6 +220,6 @@ done:
*/
typedef int vfd_socket_t;
#define vfd_get(fd) (fd)
#define vfd_open(fd) ((int)(fd))
#define vfd_open(fd) (fd)
#define vfd_free(fd)
#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