diff --git a/source/darwin/dispatch_queue_event_loop.c b/source/darwin/dispatch_queue_event_loop.c index 3fb95641f..515bb5887 100644 --- a/source/darwin/dispatch_queue_event_loop.c +++ b/source/darwin/dispatch_queue_event_loop.c @@ -153,6 +153,7 @@ static struct aws_string *s_get_unique_dispatch_queue_id(struct aws_allocator *a return result; } +#if defined(aws_event_loop_new_with_dispatch_queue) /* Setup a dispatch_queue with a scheduler. */ struct aws_event_loop *aws_event_loop_new_with_dispatch_queue( struct aws_allocator *alloc, @@ -222,6 +223,8 @@ struct aws_event_loop *aws_event_loop_new_with_dispatch_queue( return NULL; } +#endif // AWS_ENABLE_DISPATCH_QUEUE + static void s_dispatch_queue_destroy_task(void *context) { struct dispatch_loop *dispatch_loop = context; diff --git a/source/darwin/nw_socket.c b/source/darwin/nw_socket.c index 9c8e77307..84bda4a81 100644 --- a/source/darwin/nw_socket.c +++ b/source/darwin/nw_socket.c @@ -690,6 +690,7 @@ static void s_socket_impl_destroy(void *sock_ptr) { nw_socket = NULL; } +#if defined(AWS_ENABLE_DISPATCH_QUEUE) int aws_socket_init_apple_nw_socket( struct aws_socket *socket, struct aws_allocator *alloc, @@ -737,6 +738,7 @@ int aws_socket_init_apple_nw_socket( return AWS_OP_SUCCESS; } +#endif // AWS_ENABLE_DISPATCH_QUEUE static void s_client_set_dispatch_queue(struct aws_io_handle *handle, void *queue) { nw_connection_set_queue(handle->data.handle, queue); diff --git a/source/event_loop.c b/source/event_loop.c index c5cf90095..1a053abc1 100644 --- a/source/event_loop.c +++ b/source/event_loop.c @@ -107,6 +107,7 @@ enum aws_event_loop_type aws_event_loop_get_default_type(void) { AWS_LOGF_ERROR( AWS_LS_IO_EVENT_LOOP, "Failed to get default event loop type. The library is not built correctly on the platform."); + return AWS_EVENT_LOOP_PLATFORM_DEFAULT; #endif } diff --git a/source/posix/socket.c b/source/posix/socket.c index 97bbb60d1..88ee14334 100644 --- a/source/posix/socket.c +++ b/source/posix/socket.c @@ -301,7 +301,7 @@ static int s_socket_init( return AWS_OP_SUCCESS; } - +#if defined(AWS_ENABLE_KQUEUE) || defined(AWS_ENABLE_EPOLL) int aws_socket_init_posix( struct aws_socket *socket, struct aws_allocator *alloc, @@ -309,6 +309,7 @@ int aws_socket_init_posix( AWS_ASSERT(options); return s_socket_init(socket, alloc, options, -1); } +#endif // AWS_ENABLE_KQUEUE || AWS_ENABLE_EPOLL static void s_socket_clean_up(struct aws_socket *socket) { if (!socket->impl) { diff --git a/source/socket.c b/source/socket.c index 9dc27716b..15b1cc3f6 100644 --- a/source/socket.c +++ b/source/socket.c @@ -227,7 +227,7 @@ static int aws_socket_impl_type_validate_platform(enum aws_socket_impl_type type return AWS_OP_SUCCESS; } -#if !defined(AWS_ENABLE_EPOLL) && !defined(AWS_ENABLE_KQUEUE) && !defined(AWS_USE_SECITEM) +#if !defined(AWS_ENABLE_EPOLL) && !defined(AWS_ENABLE_KQUEUE) int aws_socket_init_posix( struct aws_socket *socket, struct aws_allocator *alloc, @@ -238,7 +238,7 @@ int aws_socket_init_posix( AWS_LOGF_DEBUG(AWS_LS_IO_SOCKET, "Posix socket is not supported on the platform."); return aws_raise_error(AWS_ERROR_PLATFORM_NOT_SUPPORTED); } -#endif +#endif // !AWS_ENABLE_EPOLL && !AWS_ENABLE_KQUEUE #ifndef AWS_ENABLE_IO_COMPLETION_PORTS int aws_socket_init_winsock(