Skip to content

Commit 40cee8a

Browse files
authored
Merge pull request #59457 from al45tair/fix-linux-threading-link
[Threading][Runtime] Separate threading error function to fix link on Linux.
2 parents 649889f + ab9e628 commit 40cee8a

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

stdlib/public/runtime/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ set(swift_runtime_sources
6767
RuntimeInvocationsTracking.cpp
6868
SwiftDtoa.cpp
6969
SwiftTLSContext.cpp
70+
ThreadingError.cpp
7071
AccessibleFunction.cpp)
7172

7273
# Acknowledge that the following sources are known.

stdlib/public/runtime/Errors.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -465,13 +465,3 @@ void swift::swift_abortDisabledUnicodeSupport() {
465465
"Unicode normalization data is disabled on this platform");
466466

467467
}
468-
469-
/// Halt because of a problem in the threading library
470-
SWIFT_ATTRIBUTE_NORETURN
471-
SWIFT_FORMAT(1, 2)
472-
void swift::threading::fatal(const char *msg, ...) {
473-
va_list val;
474-
va_start(val, msg);
475-
476-
swift::fatalErrorv(0, msg, val);
477-
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//===--- ThreadingError.cpp - Error handling support code -----------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
#include "swift/Runtime/Debug.h"
14+
#include "swift/Threading/Errors.h"
15+
#include <cstdio>
16+
17+
// Handle fatal errors from the threading library
18+
SWIFT_ATTRIBUTE_NORETURN
19+
SWIFT_FORMAT(1, 2)
20+
void swift::threading::fatal(const char *format, ...) {
21+
va_list val;
22+
23+
va_start(val, format);
24+
swift::fatalErrorv(0, format, val);
25+
}

0 commit comments

Comments
 (0)