GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Expose `swjs_library_features` from Swift side · ken0nek/JavaScriptKit@1336270

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Sources
    • JavaScriptKit
      • Features.swift
    • _CJavaScriptKit
      • _CJavaScriptKit.c
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Sources/JavaScriptKit/Features.swift‎

Copy file name to clipboardExpand all lines: Sources/JavaScriptKit/Features.swift
+4-8Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,13 @@ enum LibraryFeatures {
22
static let weakRefs: Int32 = 1 << 0
33
}
44

5-
@_cdecl("_library_features")
6-
func _library_features() -> Int32 {
5+
@_expose(wasm, "swjs_library_features")
6+
@_cdecl("_swjs_library_features")
7+
@available(*, unavailable)
8+
public func _swjs_library_features() -> Int32 {
79
var features: Int32 = 0
810
#if !JAVASCRIPTKIT_WITHOUT_WEAKREFS
911
features |= LibraryFeatures.weakRefs
1012
#endif
1113
return features
1214
}
13-
14-
#if compiler(>=6.0) && hasFeature(Embedded)
15-
// cdecls currently don't work in embedded, and expose for wasm only works >=6.0
16-
@_expose(wasm, "swjs_library_features")
17-
public func _swjs_library_features() -> Int32 { _library_features() }
18-
#endif
Collapse file

‎Sources/_CJavaScriptKit/_CJavaScriptKit.c‎

Copy file name to clipboardExpand all lines: Sources/_CJavaScriptKit/_CJavaScriptKit.c
-7Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,6 @@ void swjs_free_host_function(const JavaScriptHostFuncRef host_func_ref) {
4646
_free_host_function_impl(host_func_ref);
4747
}
4848

49-
int _library_features(void);
50-
51-
__attribute__((export_name("swjs_library_features")))
52-
int swjs_library_features(void) {
53-
return _library_features();
54-
}
55-
5649
int swjs_get_worker_thread_id_cached(void) {
5750
_Thread_local static int tid = 0;
5851
if (tid == 0) {

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.