Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Move private req and handle fields to platform headers
And fix other problems introduced with UV_HANDLE_TYPE_MAP and UV_REQ_TYPE_MAP.
  • Loading branch information
piscisaureus committed Apr 4, 2012
1 parent f4e7537 commit 5f38ba1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
3 changes: 3 additions & 0 deletions include/uv-private/uv-unix.h
Expand Up @@ -55,6 +55,9 @@ typedef pthread_rwlock_t uv_rwlock_t;
typedef void* uv_lib_t;
#define UV_DYNAMIC /* empty */

#define UV_HANDLE_TYPE_PRIVATE /* empty */
#define UV_REQ_TYPE_PRIVATE /* empty */

#if __linux__
# define UV_LOOP_PRIVATE_PLATFORM_FIELDS \
/* RB_HEAD(uv__inotify_watchers, uv_fs_event_s) */ \
Expand Down
8 changes: 7 additions & 1 deletion include/uv-private/uv-win.h
Expand Up @@ -206,15 +206,21 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
/* Counter to keep track of active udp streams */ \
unsigned int active_udp_streams;

#define UV_HANDLE_TYPE_PRIVATE \
UV_ARES_EVENT,

#define UV_REQ_TYPE_PRIVATE \
/* TODO: remove the req suffix */ \
UV_ACCEPT, \
UV_ARES_EVENT_REQ, \
UV_ARES_CLEANUP_REQ, \
UV_FS_EVENT_REQ, \
UV_GETADDRINFO_REQ, \
UV_PROCESS_EXIT, \
UV_PROCESS_CLOSE, \
UV_READ, \
UV_UDP_RECV, \
UV_FS_EVENT_REQ
UV_WAKEUP,

#define UV_REQ_PRIVATE_FIELDS \
union { \
Expand Down
10 changes: 4 additions & 6 deletions include/uv.h
Expand Up @@ -133,11 +133,9 @@ typedef enum {
#undef UV_ERRNO_GEN

#define UV_HANDLE_TYPE_MAP(XX) \
XX(ARES_EVENT, ares_event) \
XX(ARES_TASK, ares_task) \
XX(ASYNC, async) \
XX(CHECK, check) \
XX(FILE, file) \
XX(FS_EVENT, fs_event) \
XX(IDLE, idle) \
XX(NAMED_PIPE, pipe) \
Expand All @@ -150,11 +148,8 @@ typedef enum {

#define UV_REQ_TYPE_MAP(XX) \
XX(CONNECT, connect) \
XX(ACCEPT, accept) \
XX(READ, read) \
XX(WRITE, write) \
XX(SHUTDOWN, shutdown) \
XX(WAKEUP, wakeup) \
XX(UDP_SEND, udp_send) \
XX(FS, fs) \
XX(WORK, work) \
Expand All @@ -165,6 +160,8 @@ typedef enum {
#define XX(uc, lc) UV_##uc,
UV_HANDLE_TYPE_MAP(XX)
#undef XX
UV_FILE,
UV_HANDLE_TYPE_PRIVATE
UV_HANDLE_TYPE_MAX
} uv_handle_type;

Expand All @@ -173,7 +170,7 @@ typedef enum {
#define XX(uc, lc) UV_##uc,
UV_REQ_TYPE_MAP(XX)
#undef XX
UV_REQ_TYPE_PRIVATE,
UV_REQ_TYPE_PRIVATE
UV_REQ_TYPE_MAX
} uv_req_type;

Expand Down Expand Up @@ -1523,6 +1520,7 @@ struct uv_loop_s {


/* Don't export the private CPP symbols. */
#undef UV_HANDLE_TYPE_PRIVATE
#undef UV_REQ_TYPE_PRIVATE
#undef UV_REQ_PRIVATE_FIELDS
#undef UV_STREAM_PRIVATE_FIELDS
Expand Down

0 comments on commit 5f38ba1

Please sign in to comment.