Skip to content

Commit

Permalink
Merge branch 'grand_dispatch_queue' of github.com:awslabs/aws-c-io in…
Browse files Browse the repository at this point in the history
…to nw_socket
  • Loading branch information
xiazhvera committed Nov 9, 2024
2 parents 351c682 + afd634d commit f24d637
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ endif()

if (AWS_USE_APPLE_NETWORK_FRAMEWORK)
target_compile_definitions(${PROJECT_NAME} PRIVATE "-DAWS_USE_APPLE_NETWORK_FRAMEWORK")
option(AWS_USE_APPLE_NETWORK_FRAMEWORK
"Use apple network framework as default event loop and socket options."
ON)
endif()

target_include_directories(${PROJECT_NAME} PUBLIC
Expand Down
2 changes: 2 additions & 0 deletions source/event_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ static int aws_event_loop_type_validate_platform(enum aws_event_loop_type type)
return AWS_OP_SUCCESS;
}

#ifndef AWS_ENABLE_DISPATCH_QUEUE
struct aws_event_loop *aws_event_loop_new_dispatch_queue_with_options(
struct aws_allocator *alloc,
const struct aws_event_loop_options *options) {
Expand All @@ -628,6 +629,7 @@ struct aws_event_loop *aws_event_loop_new_dispatch_queue_with_options(
AWS_LOGF_DEBUG(AWS_LS_IO_EVENT_LOOP, "Dispatch Queue is not supported on the platform");
return NULL;
}
#endif // AWS_ENABLE_DISPATCH_QUEUE

#ifndef AWS_ENABLE_IO_COMPLETION_PORTS
struct aws_event_loop *aws_event_loop_new_iocp_with_options(
Expand Down
4 changes: 2 additions & 2 deletions source/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ int aws_socket_init(struct aws_socket *socket, struct aws_allocator *alloc, cons
case AWS_SIT_WINSOCK:
return aws_socket_init_winsock(socket, alloc, options);
break;

case AWS_SIT_APPLE_NETWORK_FRAMEWORK:
AWS_ASSERT(false && "Invalid socket implementation on platform.");
return aws_socket_init_apple_nw_socket(socket, alloc, options);
break;
default:
Expand Down Expand Up @@ -260,6 +258,7 @@ int aws_socket_init_winsock(
}
#endif

#ifndef AWS_ENABLE_DISPATCH_QUEUE
int aws_socket_init_apple_nw_socket(
struct aws_socket *socket,
struct aws_allocator *alloc,
Expand All @@ -270,3 +269,4 @@ int aws_socket_init_apple_nw_socket(
AWS_LOGF_DEBUG(AWS_LS_IO_SOCKET, "Apple Network Framework is not supported on the platform.");
return aws_raise_error(AWS_ERROR_PLATFORM_NOT_SUPPORTED);
}
#endif

0 comments on commit f24d637

Please sign in to comment.