#ifndef _WIN32_WINNT # define _WIN32_WINNT 0x0501 #endif #include #include #include #include #include #include "tree.h" /** * It should be possible to cast oio_buf[] to WSABUF[] * see http://msdn.microsoft.com/en-us/library/ms741542(v=vs.85).aspx */ typedef struct oio_buf { ULONG len; char* base; } oio_buf; #define oio_req_private_fields \ union { \ /* Used by I/O operations */ \ OVERLAPPED overlapped; \ /* Used by timers */ \ struct { \ RB_ENTRY(oio_req_s) tree_entry; \ int64_t due; \ }; \ }; \ int flags; #define oio_handle_private_fields \ union { \ SOCKET socket; \ HANDLE handle; \ }; \ SOCKET accepted_socket; \ struct oio_accept_req_s* accept_reqs; \ unsigned int flags; \ unsigned int reqs_pending; \ oio_err error;