Skip to content

Commit faa6c0f

Browse files
authored
Support Swift CXX Interop (#1160)
1 parent f58e807 commit faa6c0f

File tree

13 files changed

+20
-16
lines changed

13 files changed

+20
-16
lines changed

include/aws/common/array_list.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,11 @@ void aws_array_list_swap(struct aws_array_list *AWS_RESTRICT list, size_t a, siz
231231
AWS_COMMON_API
232232
void aws_array_list_sort(struct aws_array_list *AWS_RESTRICT list, aws_array_list_comparator_fn *compare_fn);
233233

234+
AWS_EXTERN_C_END
234235
#ifndef AWS_NO_STATIC_IMPL
235236
# include <aws/common/array_list.inl>
236237
#endif /* AWS_NO_STATIC_IMPL */
237238

238-
AWS_EXTERN_C_END
239239
AWS_POP_SANE_WARNING_LEVEL
240240

241241
#endif /* AWS_COMMON_ARRAY_LIST_H */

include/aws/common/atomics.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,12 @@ size_t aws_atomic_fetch_xor(volatile struct aws_atomic_var *var, size_t n);
318318
AWS_STATIC_IMPL
319319
void aws_atomic_thread_fence(enum aws_memory_order order);
320320

321+
AWS_EXTERN_C_END
322+
321323
#ifndef AWS_NO_STATIC_IMPL
322324
# include <aws/common/atomics.inl>
323325
#endif /* AWS_NO_STATIC_IMPL */
324326

325-
AWS_EXTERN_C_END
326327
AWS_POP_SANE_WARNING_LEVEL
327328

328329
#endif

include/aws/common/atomics.inl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ AWS_STATIC_IMPL
127127
size_t aws_atomic_fetch_xor(volatile struct aws_atomic_var *var, size_t n) {
128128
return aws_atomic_fetch_xor_explicit(var, n, aws_memory_order_seq_cst);
129129
}
130+
AWS_EXTERN_C_END
130131

131132
/* Include the backend implementation now, because we'll use its typedefs and #defines below */
132133
#if defined(__GNUC__) || defined(__clang__)
@@ -143,6 +144,4 @@ size_t aws_atomic_fetch_xor(volatile struct aws_atomic_var *var, size_t n) {
143144

144145
#include <aws/common/atomics_fallback.inl>
145146

146-
AWS_EXTERN_C_END
147-
148147
#endif /* AWS_COMMON_ATOMICS_INL */

include/aws/common/byte_order.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ AWS_STATIC_IMPL uint16_t aws_hton16(uint16_t x);
6666
*/
6767
AWS_STATIC_IMPL uint16_t aws_ntoh16(uint16_t x);
6868

69+
AWS_EXTERN_C_END
6970
#ifndef AWS_NO_STATIC_IMPL
7071
# include <aws/common/byte_order.inl>
7172
#endif /* AWS_NO_STATIC_IMPL */
7273

73-
AWS_EXTERN_C_END
7474
AWS_POP_SANE_WARNING_LEVEL
7575

7676
#endif /* AWS_COMMON_BYTE_ORDER_H */

include/aws/common/clock.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@ int aws_high_res_clock_get_ticks(uint64_t *timestamp);
5454
AWS_COMMON_API
5555
int aws_sys_clock_get_ticks(uint64_t *timestamp);
5656

57+
AWS_EXTERN_C_END
58+
5759
#ifndef AWS_NO_STATIC_IMPL
5860
# include <aws/common/clock.inl>
5961
#endif /* AWS_NO_STATIC_IMPL */
6062

61-
AWS_EXTERN_C_END
6263
AWS_POP_SANE_WARNING_LEVEL
6364

6465
#endif /* AWS_COMMON_CLOCK_H */

include/aws/common/encoding.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,12 @@ AWS_COMMON_API int aws_utf8_decoder_update(struct aws_utf8_decoder *decoder, str
224224
*/
225225
AWS_COMMON_API int aws_utf8_decoder_finalize(struct aws_utf8_decoder *decoder);
226226

227+
AWS_EXTERN_C_END
228+
227229
#ifndef AWS_NO_STATIC_IMPL
228230
# include <aws/common/encoding.inl>
229231
#endif /* AWS_NO_STATIC_IMPL */
230232

231-
AWS_EXTERN_C_END
232233
AWS_POP_SANE_WARNING_LEVEL
233234

234235
#endif /* AWS_COMMON_ENCODING_H */

include/aws/common/error.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,11 @@ int aws_translate_and_raise_io_error_or(int error_no, int fallback_aws_error_cod
149149
AWS_COMMON_API
150150
int aws_translate_and_raise_io_error(int error_no);
151151

152+
AWS_EXTERN_C_END
152153
#ifndef AWS_NO_STATIC_IMPL
153154
# include <aws/common/error.inl>
154155
#endif /* AWS_NO_STATIC_IMPL */
155156

156-
AWS_EXTERN_C_END
157-
158157
enum aws_common_error {
159158
AWS_ERROR_SUCCESS = AWS_ERROR_ENUM_BEGIN_RANGE(AWS_C_COMMON_PACKAGE_ID),
160159
AWS_ERROR_OOM,

include/aws/common/linked_list.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ AWS_STATIC_IMPL void aws_linked_list_move_all_front(
186186
* Returns true if the node is currently in a list, false otherwise.
187187
*/
188188
AWS_STATIC_IMPL bool aws_linked_list_node_is_in_list(struct aws_linked_list_node *node);
189+
AWS_EXTERN_C_END
189190

190191
#ifndef AWS_NO_STATIC_IMPL
191192
# include <aws/common/linked_list.inl>
192193
#endif /* AWS_NO_STATIC_IMPL */
193-
AWS_EXTERN_C_END
194194
AWS_POP_SANE_WARNING_LEVEL
195195

196196
#endif /* AWS_COMMON_LINKED_LIST_H */

include/aws/common/math.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,11 @@ AWS_STATIC_IMPL float aws_max_float(float a, float b);
200200
AWS_STATIC_IMPL double aws_min_double(double a, double b);
201201
AWS_STATIC_IMPL double aws_max_double(double a, double b);
202202

203+
AWS_EXTERN_C_END
203204
#ifndef AWS_NO_STATIC_IMPL
204205
# include <aws/common/math.inl>
205206
#endif /* AWS_NO_STATIC_IMPL */
206207

207-
AWS_EXTERN_C_END
208208
AWS_POP_SANE_WARNING_LEVEL
209209

210210
#endif /* AWS_COMMON_MATH_H */

include/aws/common/math.inl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
#include <limits.h>
1414
#include <stdlib.h>
1515

16-
AWS_EXTERN_C_BEGIN
17-
1816
#if defined(AWS_HAVE_GCC_OVERFLOW_MATH_EXTENSIONS) && (defined(__clang__) || !defined(__cplusplus))
1917
/*
2018
* GCC and clang have these super convenient overflow checking builtins...
@@ -48,6 +46,8 @@ AWS_EXTERN_C_BEGIN
4846
# include <aws/common/math.gcc_builtin.inl>
4947
#endif
5048

49+
AWS_EXTERN_C_BEGIN
50+
5151
#ifdef _MSC_VER
5252
# pragma warning(push)
5353
# pragma warning(disable : 4127) /*Disable "conditional expression is constant" */

0 commit comments

Comments
 (0)