Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Sources/OpenSwiftUICore/Log/Signposts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import kdebug_Private
import OpenAttributeGraphShims
#if canImport(os)
#if canImport(os.signpost)
package import os.signpost
#else
public struct OSSignpostType: Hashable, Equatable, RawRepresentable {
Expand Down Expand Up @@ -47,12 +47,12 @@ extension Signpost {
package static let eventHandling = Signpost.os_log(13, "EventHandling").published
}

#if canImport(Darwin)
#if canImport(os.signpost)
private let _signpostLog = OSLog(subsystem: Log.subsystem, category: "OpenSwiftUI")
#endif

package struct Signpost {
#if canImport(Darwin) && !OPENSWIFTUI_SWIFT_LOG
#if canImport(os.signpost) && !OPENSWIFTUI_SWIFT_LOG

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. OSSignposter is not in os.signpost. Change if canImport Darwin to canImport os LGTM.

  2. We do not intent to support older SDK compiler. You can leave those changes in your fork.

package static let archiving = OSSignposter(logger: Log.archiving)
package static let metaExtraction = OSSignposter(logger: Log.metadataExtraction)
#endif
Expand Down Expand Up @@ -124,7 +124,7 @@ package struct Signpost {
guard Stability.valid.contains(stability) else {
return false
}
#if canImport(Darwin)
#if canImport(os.signpost)
switch style {
case let .kdebug(code):
return kdebug_is_enabled(MISC_INSTRUMENTS_DGB_EVENT_CODE(code: code))
Expand All @@ -148,7 +148,7 @@ package struct Signpost {
guard isEnabled else {
return closure()
}
#if canImport(Darwin)
#if canImport(os.signpost)
let id = OSSignpostID.makeExclusiveID(object)
switch style {
case let .kdebug(code):
Expand Down Expand Up @@ -179,7 +179,7 @@ package struct Signpost {
guard isEnabled else {
return closure()
}
#if canImport(Darwin)
#if canImport(os.signpost)
let id = OSSignpostID.makeExclusiveID(object)
let args = args()
switch style {
Expand Down Expand Up @@ -207,7 +207,7 @@ package struct Signpost {
guard isEnabled else {
return
}
#if canImport(Darwin)
#if canImport(os.signpost)
let id = OSSignpostID.makeExclusiveID(object)
let args = args()
switch style {
Expand All @@ -220,7 +220,7 @@ package struct Signpost {
}


#if canImport(Darwin)
#if canImport(os.signpost)
@inline(__always)
private var styleCode: UInt8 {
switch style {
Expand Down Expand Up @@ -255,7 +255,7 @@ package struct Signpost {
#endif
}

#if canImport(os)
#if canImport(os.signpost)
extension OSSignpostID {
fileprivate static let continuation = OSSignpostID(0x0ea89ce2)

Expand Down Expand Up @@ -286,7 +286,7 @@ func os_signpost(
}
#endif

#if canImport(Darwin)
#if canImport(os.signpost)

// MARK: - kdebug

Expand Down
2 changes: 1 addition & 1 deletion Sources/OpenSwiftUICore/Tracing/Tracing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import WASILibc
import OpenAttributeGraphShims
import Foundation
import OpenSwiftUICSymbols
#if canImport(Darwin)
#if canImport(os.log)
import os.log
#endif

Expand Down