Skip to content

Commit 7bc77c2

Browse files
authored
Merge pull request #33 from apple/jgrynspan/rename-isfifo
Rename `swt_isFIFO()` to match the macro it shadows.
2 parents bb464ff + febd5fd commit 7bc77c2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Sources/Testing/Running/XCTestScaffold.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ extension [Event.Recorder.Option] {
242242
// invokes the testing library, for example.
243243
#if SWT_TARGET_OS_APPLE || os(Linux)
244244
var statStruct = stat()
245-
if 0 == fstat(STDERR_FILENO, &statStruct) && swt_isFIFO(statStruct.st_mode) {
245+
if 0 == fstat(STDERR_FILENO, &statStruct) && swt_S_ISFIFO(statStruct.st_mode) {
246246
return true
247247
}
248248
#elseif os(Windows)

Sources/TestingInternals/include/Stubs.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ static FILE *swt_stderr(void) {
2828
#if __has_include(<sys/stat.h>) && defined(S_ISFIFO)
2929
/// Check if a given `mode_t` value indicates that a file is a pipe (FIFO.)
3030
///
31-
/// This function is necessary because the mode flag macros are not all
32-
/// imported into Swift.
33-
static bool swt_isFIFO(mode_t mode) {
31+
/// This function is exactly equivalent to the `S_ISFIFO()` macro. It is
32+
/// necessary because the mode flag macros are not imported into Swift
33+
/// consistently across platforms.
34+
static bool swt_S_ISFIFO(mode_t mode) {
3435
return S_ISFIFO(mode);
3536
}
3637
#endif

0 commit comments

Comments
 (0)