mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-08-10 00:33:28 +08:00
🐛 fix(native-window): 修复 Intel macOS 构建类型转换错误
将 Cocoa BOOL 桥接结果统一转换为整数值。 兼容 darwin/amd64 与 darwin/arm64 的 cgo 类型映射。
This commit is contained in:
@@ -63,9 +63,11 @@ static void prepareDetachedAccessoryActivationPolicy(void) {
|
||||
}
|
||||
}
|
||||
|
||||
static BOOL isDetachedAccessoryActivationPolicyGuardInstalled(void) {
|
||||
// Cocoa BOOL maps to different cgo types on Intel and Apple Silicon. Normalise
|
||||
// the bridge result to int so the Go side remains portable across both targets.
|
||||
static int isDetachedAccessoryActivationPolicyGuardInstalled(void) {
|
||||
@synchronized ([NSApplication class]) {
|
||||
return detachedAccessoryActivationPolicyGuardActive;
|
||||
return detachedAccessoryActivationPolicyGuardActive ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +93,7 @@ func prepareDetachedAccessoryActivationPolicy() {
|
||||
}
|
||||
|
||||
func detachedAccessoryActivationPolicyGuardInstalled() bool {
|
||||
return bool(C.isDetachedAccessoryActivationPolicyGuardInstalled())
|
||||
return C.isDetachedAccessoryActivationPolicyGuardInstalled() != 0
|
||||
}
|
||||
|
||||
func setDetachedAccessoryActivationPolicy() {
|
||||
|
||||
Reference in New Issue
Block a user