diff --git a/src/core/iomgr/udp_server.c b/src/core/iomgr/udp_server.c index 782fbd9f469..28f1bfae26d 100644 --- a/src/core/iomgr/udp_server.c +++ b/src/core/iomgr/udp_server.c @@ -38,6 +38,7 @@ #include +#ifdef GRPC_NEED_UDP #ifdef GPR_POSIX_SOCKET #include "src/core/iomgr/udp_server.h" @@ -435,3 +436,4 @@ void grpc_udp_server_write(server_port *sp, const char *buffer, size_t buf_len, } #endif +#endif diff --git a/test/core/iomgr/udp_server_test.c b/test/core/iomgr/udp_server_test.c index 86e87679378..85e28732e46 100644 --- a/test/core/iomgr/udp_server_test.c +++ b/test/core/iomgr/udp_server_test.c @@ -43,6 +43,8 @@ #include #include +#ifdef GRPC_NEED_UDP + #define LOG_TEST(x) gpr_log(GPR_INFO, "%s", #x) static grpc_pollset g_pollset; @@ -195,3 +197,9 @@ int main(int argc, char **argv) { grpc_iomgr_shutdown(); return 0; } + +#else + +int main(int argc, char **argv) { return 0; } + +#endif