Skip to content

Commit fe93d0a

Browse files
authored
Update CMake to 3.9 (#686)
1 parent e363740 commit fe93d0a

File tree

3 files changed

+15
-60
lines changed

3 files changed

+15
-60
lines changed

CMakeLists.txt

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11

2-
cmake_minimum_required(VERSION 3.1)
2+
cmake_minimum_required(VERSION 3.9)
33
project(aws-c-io C)
44

5-
if (POLICY CMP0069)
6-
cmake_policy(SET CMP0069 NEW) # Enable LTO/IPO if available in the compiler, see AwsCFlags
7-
endif()
8-
95
if (DEFINED CMAKE_PREFIX_PATH)
106
file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH)
117
endif()

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This library is licensed under the Apache 2.0 License.
1818

1919
### Building
2020

21-
CMake 3.1+ is required to build.
21+
CMake 3.9+ is required to build.
2222

2323
`<install-path>` must be an absolute path in the following instructions.
2424

source/future.c

+13-54
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@ struct aws_future_impl {
5656
};
5757

5858
static void s_future_impl_result_dtor(struct aws_future_impl *future, void *result_addr) {
59+
60+
/*
61+
* On ARM machines, the compiler complains about the array bounds warning for aws_future_bool, even though
62+
* aws_future_bool will never go into any destroy or release branch. Disable the warning since it's a false positive.
63+
*/
64+
#ifndef _MSC_VER
65+
# pragma GCC diagnostic push
66+
# pragma GCC diagnostic ignored "-Warray-bounds"
67+
#endif
5968
switch (future->type) {
6069
case AWS_FUTURE_T_BY_VALUE_WITH_CLEAN_UP: {
6170
future->result_dtor.clean_up(result_addr);
@@ -79,6 +88,9 @@ static void s_future_impl_result_dtor(struct aws_future_impl *future, void *resu
7988
default:
8089
break;
8190
}
91+
#ifndef _MSC_VER
92+
# pragma GCC diagnostic pop
93+
#endif
8294
}
8395

8496
static void s_future_impl_destroy(void *user_data) {
@@ -472,60 +484,7 @@ bool aws_future_impl_wait(const struct aws_future_impl *future, uint64_t timeout
472484
return is_done;
473485
}
474486

475-
// AWS_FUTURE_T_BY_VALUE_IMPLEMENTATION(aws_future_bool, bool)
476-
struct aws_future_bool *aws_future_bool_new(struct aws_allocator *alloc) {
477-
return (struct aws_future_bool *)aws_future_impl_new_by_value(alloc, sizeof(_Bool));
478-
}
479-
void aws_future_bool_set_result(struct aws_future_bool *future, _Bool result) {
480-
aws_future_impl_set_result_by_move((struct aws_future_impl *)future, &result);
481-
}
482-
_Bool aws_future_bool_get_result(const struct aws_future_bool *future) {
483-
return *(_Bool *)aws_future_impl_get_result_address((const struct aws_future_impl *)future);
484-
}
485-
struct aws_future_bool *aws_future_bool_acquire(struct aws_future_bool *future) {
486-
return (struct aws_future_bool *)aws_future_impl_acquire((struct aws_future_impl *)future);
487-
}
488-
struct aws_future_bool *aws_future_bool_release(struct aws_future_bool *future) {
489-
return (struct aws_future_bool *)aws_future_impl_release((struct aws_future_impl *)future);
490-
}
491-
void aws_future_bool_set_error(struct aws_future_bool *future, int error_code) {
492-
aws_future_impl_set_error((struct aws_future_impl *)future, error_code);
493-
}
494-
_Bool aws_future_bool_is_done(const struct aws_future_bool *future) {
495-
return aws_future_impl_is_done((const struct aws_future_impl *)future);
496-
}
497-
int aws_future_bool_get_error(const struct aws_future_bool *future) {
498-
return aws_future_impl_get_error((const struct aws_future_impl *)future);
499-
}
500-
void aws_future_bool_register_callback(
501-
struct aws_future_bool *future,
502-
aws_future_callback_fn *on_done,
503-
void *user_data) {
504-
aws_future_impl_register_callback((struct aws_future_impl *)future, on_done, user_data);
505-
}
506-
_Bool aws_future_bool_register_callback_if_not_done(
507-
struct aws_future_bool *future,
508-
aws_future_callback_fn *on_done,
509-
void *user_data) {
510-
return aws_future_impl_register_callback_if_not_done((struct aws_future_impl *)future, on_done, user_data);
511-
}
512-
void aws_future_bool_register_event_loop_callback(
513-
struct aws_future_bool *future,
514-
struct aws_event_loop *event_loop,
515-
aws_future_callback_fn *on_done,
516-
void *user_data) {
517-
aws_future_impl_register_event_loop_callback((struct aws_future_impl *)future, event_loop, on_done, user_data);
518-
}
519-
void aws_future_bool_register_channel_callback(
520-
struct aws_future_bool *future,
521-
struct aws_channel *channel,
522-
aws_future_callback_fn *on_done,
523-
void *user_data) {
524-
aws_future_impl_register_channel_callback((struct aws_future_impl *)future, channel, on_done, user_data);
525-
}
526-
_Bool aws_future_bool_wait(struct aws_future_bool *future, uint64_t timeout_ns) {
527-
return aws_future_impl_wait((struct aws_future_impl *)future, timeout_ns);
528-
}
487+
AWS_FUTURE_T_BY_VALUE_IMPLEMENTATION(aws_future_bool, bool)
529488

530489
AWS_FUTURE_T_BY_VALUE_IMPLEMENTATION(aws_future_size, size_t)
531490

0 commit comments

Comments
 (0)