Skip to content

Commit 79e3928

Browse files
authored
Fix Wasm-specific warnings. (#590)
This PR fixes a couple of (harmless) warnings when building for Wasm. ### 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 5ab0587 commit 79e3928

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Sources/Testing/Support/Additions/CommandLineAdditions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ extension CommandLine {
5252
// WASI does not really have the concept of a file system path to the main
5353
// executable, so simply return the first argument--presumably the program
5454
// name, but as you know this is not guaranteed by the C standard!
55-
return String(cString: arguments[0])
55+
return arguments[0]
5656
#else
5757
#warning("Platform-specific implementation missing: executable path unavailable")
5858
return ""

Sources/_TestingInternals/include/Includes.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@
4747
#include <unistd.h>
4848
#endif
4949

50-
#if __has_include(<sys/fcntl.h>)
50+
#if __has_include(<fcntl.h>)
51+
#include <fcntl.h>
52+
#elif __has_include(<sys/fcntl.h>)
5153
#include <sys/fcntl.h>
5254
#endif
5355

0 commit comments

Comments
 (0)