libuv: stop g++ from complaining about anonymous struct usage
authorBert Belder <bertbelder@gmail.com>
Fri, 15 Jul 2011 22:31:47 +0000 (00:31 +0200)
committerBert Belder <bertbelder@gmail.com>
Fri, 15 Jul 2011 22:31:47 +0000 (00:31 +0200)
deps/uv/include/uv-unix.h
deps/uv/include/uv-win.h
deps/uv/include/uv.h
deps/uv/src/uv-win.c

index 50b29c7..5a92f12 100644 (file)
@@ -55,6 +55,8 @@ typedef struct {
 #define UV_CONNECT_PRIVATE_FIELDS \
   ngx_queue_t queue;
 
+#define UV_PRIVATE_REQ_TYPES /* empty */
+
 
 /* TODO: union or classes please! */
 #define UV_HANDLE_PRIVATE_FIELDS \
@@ -79,8 +81,8 @@ typedef struct {
   ev_io write_watcher; \
   ngx_queue_t write_queue; \
   ngx_queue_t write_completed_queue;
-  
-  
+
+
 /* UV_NAMED_PIPE */
 #define UV_PIPE_PRIVATE_TYPEDEF
 #define UV_PIPE_PRIVATE_FIELDS
index e0bfa84..d9f65ba 100644 (file)
@@ -62,6 +62,13 @@ typedef struct uv_buf_t {
 #define UV_SHUTDOWN_PRIVATE_FIELDS        \
   /* empty */
 
+#define UV_PRIVATE_REQ_TYPES              \
+  typedef struct uv_pipe_accept_s {       \
+    UV_REQ_FIELDS                         \
+    HANDLE pipeHandle;                    \
+    struct uv_pipe_accept_s* next_pending; \
+  } uv_pipe_accept_t;
+
 #define uv_stream_connection_fields       \
   unsigned int write_reqs_pending;        \
   uv_shutdown_t* shutdown_req;
@@ -90,12 +97,8 @@ typedef struct uv_buf_t {
 
 #define uv_pipe_server_fields             \
     char* name;                           \
-    struct uv_pipe_accept_s {             \
-      UV_REQ_FIELDS                       \
-      HANDLE pipeHandle;                  \
-      struct uv_pipe_accept_s* next_pending; \
-    } accept_reqs[4];                     \
-    struct uv_pipe_accept_s* pending_accepts;
+    uv_pipe_accept_t accept_reqs[4];      \
+    uv_pipe_accept_t* pending_accepts;
 
 #define uv_pipe_connection_fields         \
   HANDLE handle;
index 1f8c1ce..4382225 100644 (file)
@@ -185,6 +185,10 @@ struct uv_req_s {
 };
 
 
+/* Platform-specific request types */
+UV_PRIVATE_REQ_TYPES
+
+
 /*
  * Shutdown the outgoing (write) side of a duplex stream. It waits for
  * pending write requests to complete. The handle should refer to a
index a4478f5..111d99c 100644 (file)
@@ -993,7 +993,7 @@ static void uv_tcp_queue_accept(uv_tcp_t* handle) {
 }
 
 
-static void uv_pipe_queue_accept(uv_pipe_t* handle, struct uv_pipe_accept_s* req) {
+static void uv_pipe_queue_accept(uv_pipe_t* handle, uv_pipe_accept_t* req) {
   HANDLE pipeHandle;
 
   assert(handle->flags & UV_HANDLE_LISTENING);
@@ -1173,7 +1173,7 @@ static int uv_tcp_accept(uv_tcp_t* server, uv_tcp_t* client) {
 
 static int uv_pipe_accept(uv_pipe_t* server, uv_pipe_t* client) {
   /* Find a connection instance that has been connected, but not yet accepted. */
-  struct uv_pipe_accept_s* req = server->pending_accepts;
+  uv_pipe_accept_t* req = server->pending_accepts;
 
   if (!req) {
     /* No valid connections found, so we error out. */
@@ -1847,7 +1847,7 @@ static void uv_process_pipe_write_req(uv_pipe_t* handle, uv_write_t* req) {
 
 
 static void uv_process_pipe_accept_req(uv_pipe_t* handle, uv_req_t* raw_req) {
-  struct uv_pipe_accept_s* req = (struct uv_pipe_accept_s*) raw_req;
+  uv_pipe_accept_t* req = (uv_pipe_accept_t*) raw_req;
 
   assert(handle->type == UV_NAMED_PIPE);
 
@@ -2981,7 +2981,7 @@ int uv_pipe_init(uv_pipe_t* handle) {
 /* TODO: make this work with UTF8 name */
 int uv_pipe_bind(uv_pipe_t* handle, const char* name) {
   int i;
-  struct uv_pipe_accept_s* req;
+  uv_pipe_accept_t* req;
 
   if (!name) {
     uv_set_sys_error(WSAEINVAL);