Skip to content

Commit 09c8d09

Browse files
committed
Fix for OpenBSD
1 parent 4a70808 commit 09c8d09

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Sources/Logging/Logging.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,7 @@ public struct MultiplexLogHandler: LogHandler {
13121312
}
13131313
}
13141314

1315-
#if canImport(WASILibc) || os(Android)
1315+
#if canImport(WASILibc) || os(Android) || os(OpenBSD)
13161316
internal typealias CFilePointer = OpaquePointer
13171317
#else
13181318
internal typealias CFilePointer = UnsafeMutablePointer<FILE>

Tests/LoggingTests/TestLogger.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,10 @@ public class MDC {
375375
return Int(pthread_mach_thread_np(pthread_self()))
376376
#elseif os(Windows)
377377
return Int(GetCurrentThreadId())
378-
#elseif os(FreeBSD) || os(OpenBSD)
378+
#elseif os(FreeBSD)
379379
return Int(pthread_getthreadid_np())
380+
#elseif os(OpenBSD)
381+
return Int(bitPattern: pthread_self())
380382
#else
381383
return Int(pthread_self())
382384
#endif

0 commit comments

Comments
 (0)