Skip to content

Commit d45edbe

Browse files
Remove FILETextOutputStream, etc. (#753)
This needed to be tweaked recently to migrate SWBUtil to Swift 6, and caused a build breakage in the process. Turns out this is dead code and not needed, so just eliminate it.
1 parent 8d3d1d0 commit d45edbe

File tree

3 files changed

+0
-54
lines changed

3 files changed

+0
-54
lines changed

Sources/SWBCLibc/include/SWBCLibc.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#include <stdio.h>
14-
15-
extern FILE * const swb_stdout();
16-
extern FILE * const swb_stderr();
17-
1813
#if defined(__linux__) && !defined(__ANDROID__)
1914
#include <fcntl.h>
2015
#include <fnmatch.h>

Sources/SWBCLibc/libc.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,3 @@ int swb_clibc_anchor(void);
1818
int swb_clibc_anchor(void) {
1919
return 0;
2020
}
21-
22-
#include <stdio.h>
23-
24-
extern FILE * const swb_stdout();
25-
extern FILE * const swb_stderr();
26-
27-
#if defined(_WIN32)
28-
__declspec(dllexport)
29-
#endif
30-
FILE * const swb_stdout() {
31-
return stdout;
32-
}
33-
34-
#if defined(_WIN32)
35-
__declspec(dllexport)
36-
#endif
37-
FILE * const swb_stderr() {
38-
return stderr;
39-
}

Sources/SWBUtil/Misc.swift

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -65,36 +65,6 @@ public func parseUmbrellaHeaderName(_ string: String) -> String? {
6565
return Static.regex.matchGroups(in: string).first?[0]
6666
}
6767

68-
#if os(Android)
69-
public typealias FILEPointer = OpaquePointer
70-
#else
71-
public typealias FILEPointer = UnsafeMutablePointer<FILE>
72-
#endif
73-
74-
/// Adapts a FILE to a TextOutputStream. Does not own or automatically close the file.
75-
public struct FILETextOutputStream: TextOutputStream {
76-
let stream: FILEPointer
77-
78-
public init(_ stream: FILEPointer) {
79-
self.stream = stream
80-
}
81-
82-
public func write(_ string: String) {
83-
fputs(string, stream)
84-
}
85-
86-
public static var stdout: Self {
87-
.init(SWBLibc.swb_stdout())
88-
}
89-
90-
public static var stderr: Self {
91-
.init(SWBLibc.swb_stderr())
92-
}
93-
}
94-
95-
@available(*, unavailable)
96-
extension FILETextOutputStream: Sendable { }
97-
9868
#if canImport(Darwin)
9969
public import func Foundation.autoreleasepool
10070
#endif

0 commit comments

Comments
 (0)