| 1 | #ifndef AWS_COMMON_ERROR_INL |
| 2 | #define AWS_COMMON_ERROR_INL |
| 3 | |
| 4 | /* |
| 5 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 6 | * |
| 7 | * Licensed under the Apache License, Version 2.0 (the "License"). |
| 8 | * You may not use this file except in compliance with the License. |
| 9 | * A copy of the License is located at |
| 10 | * |
| 11 | * http://aws.amazon.com/apache2.0 |
| 12 | * |
| 13 | * or in the "license" file accompanying this file. This file is distributed |
| 14 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
| 15 | * express or implied. See the License for the specific language governing |
| 16 | * permissions and limitations under the License. |
| 17 | */ |
| 18 | |
| 19 | #include <aws/common/error.h> |
| 20 | |
| 21 | AWS_EXTERN_C_BEGIN |
| 22 | |
| 23 | /* |
| 24 | * Raises `err` to the installed callbacks, and sets the thread's error. |
| 25 | */ |
| 26 | AWS_STATIC_IMPL |
| 27 | int aws_raise_error(int err) { |
| 28 | /* |
| 29 | * Certain static analyzers can't see through the out-of-line call to aws_raise_error, |
| 30 | * and assume that this might return AWS_OP_SUCCESS. We'll put the return inline just |
| 31 | * to help with their assumptions. |
| 32 | */ |
| 33 | |
| 34 | aws_raise_error_private(err); |
| 35 | |
| 36 | return AWS_OP_ERR; |
| 37 | } |
| 38 | |
| 39 | AWS_EXTERN_C_END |
| 40 | |
| 41 | #endif /* AWS_COMMON_ERROR_INL */ |
| 42 | |