Skip to content

Commit 0cd155c

Browse files
authored
Revert "Use C to force the POSIX (not GNU) overload of strerror_r to be selected" (#498)
This reverts commit baa8180.
1 parent baa8180 commit 0cd155c

File tree

6 files changed

+4
-18
lines changed

6 files changed

+4
-18
lines changed

Sources/TSCBasic/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ add_library(TSCBasic
5252
misc.swift)
5353

5454
target_compile_options(TSCBasic PUBLIC
55+
# Don't use GNU strerror_r on Android.
56+
"$<$<PLATFORM_ID:Android>:SHELL:-Xcc -U_GNU_SOURCE>"
5557
# Ignore secure function warnings on Windows.
5658
"$<$<PLATFORM_ID:Windows>:SHELL:-Xcc -D_CRT_SECURE_NO_WARNINGS>")
5759
target_link_libraries(TSCBasic PRIVATE

Sources/TSCBasic/misc.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
See http://swift.org/CONTRIBUTORS.txt for Swift project authors
99
*/
1010

11-
@_implementationOnly import TSCclibc
1211
import TSCLibc
1312
import Foundation
1413
#if os(Windows)
@@ -328,7 +327,7 @@ extension SystemError: CustomStringConvertible {
328327
var cap = 64
329328
while cap <= 16 * 1024 {
330329
var buf = [Int8](repeating: 0, count: cap)
331-
let err = TSCclibc.tsc_strerror_r(errno, &buf, buf.count)
330+
let err = TSCLibc.strerror_r(errno, &buf, buf.count)
332331
if err == EINVAL {
333332
return "Unknown error \(errno)"
334333
}

Sources/TSCclibc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# See http://swift.org/CONTRIBUTORS.txt for Swift project authors
88

99
add_library(TSCclibc STATIC
10-
libc.c process.c strerror.c)
10+
libc.c process.c)
1111
target_include_directories(TSCclibc PUBLIC
1212
include)
1313
target_compile_definitions(TSCclibc PRIVATE

Sources/TSCclibc/include/module.modulemap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@ module TSCclibc {
22
header "TSCclibc.h"
33
header "indexstore_functions.h"
44
header "process.h"
5-
header "strerror.h"
65
export *
76
}

Sources/TSCclibc/include/strerror.h

Lines changed: 0 additions & 5 deletions
This file was deleted.

Sources/TSCclibc/strerror.c

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)