diff --git a/src/core/iomgr/udp_server.h b/src/core/iomgr/udp_server.h index 1e59a92392d..148c04fa9be 100644 --- a/src/core/iomgr/udp_server.h +++ b/src/core/iomgr/udp_server.h @@ -37,15 +37,16 @@ #include "src/core/iomgr/endpoint.h" #include "src/core/iomgr/fd_posix.h" -/* Forward decl of grpc_server */ -typedef struct grpc_server grpc_server; +/* Forward decl of struct grpc_server */ +/* This is not typedef'ed to avoid a typedef-redefinition error */ +struct grpc_server; /* Forward decl of grpc_udp_server */ typedef struct grpc_udp_server grpc_udp_server; /* Called when data is available to read from the socket. */ typedef void (*grpc_udp_server_read_cb)(grpc_exec_ctx *exec_ctx, grpc_fd *emfd, - grpc_server *server); + struct grpc_server *server); /* Create a server, initially not bound to any ports */ grpc_udp_server *grpc_udp_server_create(void); @@ -53,7 +54,7 @@ grpc_udp_server *grpc_udp_server_create(void); /* Start listening to bound ports */ void grpc_udp_server_start(grpc_exec_ctx *exec_ctx, grpc_udp_server *udp_server, grpc_pollset **pollsets, size_t pollset_count, - grpc_server *server); + struct grpc_server *server); int grpc_udp_server_get_fd(grpc_udp_server *s, unsigned index); diff --git a/test/core/iomgr/udp_server_test.c b/test/core/iomgr/udp_server_test.c index ce3c23b4bf2..365b5c002bf 100644 --- a/test/core/iomgr/udp_server_test.c +++ b/test/core/iomgr/udp_server_test.c @@ -34,6 +34,7 @@ #include "src/core/iomgr/iomgr.h" #include "src/core/iomgr/pollset_posix.h" #include "src/core/iomgr/udp_server.h" +#include #include #include #include