Skip to content

Commit d3b0af5

Browse files
authored
Remove non-functional swt_getWASIVersion(). (#1398)
A while back I implemented `swt_getWASIVersion()` to speculatively return the value of `WASI_SDK_VERSION` as defined by WASI, but that never landed and the [GitHub issue](WebAssembly/wasi-libc#490) for it was closed. Remove the inoperative helper function here. ### Checklist: - [x] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [x] If public symbols are renamed or modified, DocC references should be updated.
1 parent db33906 commit d3b0af5

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

Sources/Testing/Support/Versions.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,8 @@ let operatingSystemVersion: String = {
8989
}
9090
}
9191
#elseif os(WASI)
92-
if let version = swt_getWASIVersion().flatMap(String.init(validatingCString:)) {
93-
return version
94-
}
92+
// WASI does not have an API to get the current WASI or Wasm version.
93+
// wasi-libc does have uname(3), but it's stubbed out.
9594
#else
9695
#warning("Platform-specific implementation missing: OS version unavailable")
9796
#endif

Sources/_TestingInternals/include/Versions.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,24 +53,6 @@ SWT_EXTERN void swt_getTestingLibraryCommit(const char *_Nullable *_Nonnull outH
5353
/// testing library, or `nullptr` if that information is not available.
5454
SWT_EXTERN const char *_Nullable swt_getTargetTriple(void);
5555

56-
#if defined(__wasi__)
57-
/// Get the version of the C standard library and runtime used by WASI, if
58-
/// available.
59-
///
60-
/// This function is provided because `WASI_SDK_VERSION` may or may not be
61-
/// defined and may or may not be a complex macro.
62-
///
63-
/// For more information about the `WASI_SDK_VERSION` macro, see
64-
/// [wasi-libc-#490](https://github.com/WebAssembly/wasi-libc/issues/490).
65-
static const char *_Nullable swt_getWASIVersion(void) {
66-
#if defined(WASI_SDK_VERSION)
67-
return WASI_SDK_VERSION;
68-
#else
69-
return 0;
70-
#endif
71-
}
72-
#endif
73-
7456
SWT_ASSUME_NONNULL_END
7557

7658
#endif

0 commit comments

Comments
 (0)