File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
_TestingInternals/include Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -246,7 +246,7 @@ extension Test.Attachment {
246246 file = try FileHandle ( atPath: preferredPath, mode: " wxb " )
247247 result = preferredPath
248248 break
249- } catch let error as CError where error. rawValue == EEXIST {
249+ } catch let error as CError where error. rawValue == swt_EEXIST ( ) {
250250 // Try again with a new suffix.
251251 continue
252252 } catch where usingPreferredName {
Original file line number Diff line number Diff line change @@ -154,6 +154,14 @@ static int swt_siginfo_t_si_status(const siginfo_t *siginfo) {
154154#endif
155155#endif
156156
157+ /// Get the value of `EEXIST`.
158+ ///
159+ /// This function is provided because `EEXIST` is a complex macro in wasi-libc
160+ /// and cannot be imported directly into Swift.
161+ static int swt_EEXIST (void ) {
162+ return EEXIST ;
163+ }
164+
157165SWT_ASSUME_NONNULL_END
158166
159167#endif
You can’t perform that action at this time.
0 commit comments