Skip to content

Commit cf041b1

Browse files
committed
address pltaform orders and other nits
1 parent d681126 commit cf041b1

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

lib/AST/PlatformKind.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ swift::tripleOSTypeForPlatform(PlatformKind platform) {
286286
case PlatformKind::visionOS:
287287
case PlatformKind::visionOSApplicationExtension:
288288
return llvm::Triple::XROS;
289+
case PlatformKind::FreeBSD:
290+
return llvm::Triple::FreeBSD;
289291
case PlatformKind::OpenBSD:
290292
return llvm::Triple::OpenBSD;
291293
case PlatformKind::Windows:

lib/IRGen/TBDGen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,10 @@ getLinkerPlatformId(OriginallyDefinedInAttr::ActiveVersion Ver,
245245
switch(Ver.Platform) {
246246
case swift::PlatformKind::none:
247247
llvm_unreachable("cannot find platform kind");
248-
case swift::PlatformKind::OpenBSD:
249-
llvm_unreachable("not used for this platform");
250248
case swift::PlatformKind::FreeBSD:
251249
llvm_unreachable("not used for this platform");
250+
case swift::PlatformKind::OpenBSD:
251+
llvm_unreachable("not used for this platform");
252252
case swift::PlatformKind::Windows:
253253
llvm_unreachable("not used for this platform");
254254
case swift::PlatformKind::iOS:

stdlib/public/Platform/Platform.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,4 +387,7 @@ public var environ: UnsafeMutablePointer<UnsafeMutablePointer<CChar>?> {
387387

388388
#if os(FreeBSD)
389389
public let inet_pton = __inet_pton
390+
@inlinable public func inet_pton(_ af: CInt, _ src: UnsafePointer<CChar>!, _ dst: UnsafeMutableRawPointer!) -> CInt {
391+
__inet_pton(af, src, dst)
392+
}
390393
#endif

stdlib/public/Platform/glibc.modulemap.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/// It's not named just Glibc so that it doesn't conflict in the event of a
2020
/// future official glibc modulemap.
2121
module SwiftGlibc [system] {
22-
% if CMAKE_SDK in ["LINUX", "OPENBSD", "FREEBSD"]:
22+
% if CMAKE_SDK in ["LINUX", "FREEBSD", "OPENBSD"]:
2323
link "m"
2424
% end
2525
% if CMAKE_SDK in ["LINUX", "FREEBSD", "OPENBSD", "CYGWIN"]:

stdlib/public/runtime/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ set(swift_runtime_backtracing_sources
9393
Backtrace.cpp
9494
BacktraceUtils.cpp
9595
CrashHandlerMacOS.cpp
96-
CrashHandlerLinux.cpp
97-
)
96+
CrashHandlerLinux.cpp)
9897

9998
# Acknowledge that the following sources are known.
10099
set(LLVM_OPTIONAL_SOURCES

0 commit comments

Comments
 (0)