From 64c95267c3c9a505e3326bd5821a1ad63097901e Mon Sep 17 00:00:00 2001 From: STREGA Date: Sat, 5 Aug 2023 15:04:29 -0400 Subject: [PATCH 1/2] Remove duplicated generic definition The functions parent scope already defines the same generic. --- Sources/JavaScriptKit/ConvertibleToJSValue.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/JavaScriptKit/ConvertibleToJSValue.swift b/Sources/JavaScriptKit/ConvertibleToJSValue.swift index 638672ca5..4b9bf8f03 100644 --- a/Sources/JavaScriptKit/ConvertibleToJSValue.swift +++ b/Sources/JavaScriptKit/ConvertibleToJSValue.swift @@ -256,7 +256,7 @@ extension Array where Element == ConvertibleToJSValue { // fast path for empty array guard self.count != 0 else { return body([]) } - func _withRawJSValues( + func _withRawJSValues( _ values: [ConvertibleToJSValue], _ index: Int, _ results: inout [RawJSValue], _ body: ([RawJSValue]) -> T ) -> T { From 710a5e326efe51107b9760b8c206e66832d3ef50 Mon Sep 17 00:00:00 2001 From: STREGA Date: Sat, 5 Aug 2023 15:19:32 -0400 Subject: [PATCH 2/2] Restrict wasi attributes to wasi builds Added simply to silence unknown attribute warnings when building for macOS using Xcode. --- .../_CJavaScriptBigIntSupport/include/_CJavaScriptKit+I64.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/_CJavaScriptBigIntSupport/include/_CJavaScriptKit+I64.h b/Sources/_CJavaScriptBigIntSupport/include/_CJavaScriptKit+I64.h index dc898c43c..a04be1c2e 100644 --- a/Sources/_CJavaScriptBigIntSupport/include/_CJavaScriptKit+I64.h +++ b/Sources/_CJavaScriptBigIntSupport/include/_CJavaScriptKit+I64.h @@ -8,16 +8,20 @@ /// /// @param value The value to convert. /// @param is_signed Whether to treat the value as a signed integer or not. +#if __wasi__ __attribute__((__import_module__("javascript_kit"), __import_name__("swjs_i64_to_bigint"))) +#endif extern JavaScriptObjectRef _i64_to_bigint(const long long value, bool is_signed); /// Converts the provided BigInt to an Int64 or UInt64. /// /// @param ref The target JavaScript object. /// @param is_signed Whether to treat the return value as a signed integer or not. +#if __wasi__ __attribute__((__import_module__("javascript_kit"), __import_name__("swjs_bigint_to_i64"))) +#endif extern long long _bigint_to_i64(const JavaScriptObjectRef ref, bool is_signed); #endif /* _CJavaScriptBigIntSupport_h */