Update to Big Sur 15.5.2 / Clang 12.0.5. Improved handing of avaiability

attributes and boolean values.
This commit is contained in:
gmp
2021-11-16 16:02:08 -05:00
parent f4a9dae250
commit e4f7e32887
21 changed files with 482 additions and 9157 deletions
+5 -5
View File
@@ -34,7 +34,7 @@ func didFinishLaunching(self ns.AppDelegate, n *ns.NSNotification) {
ns.NSWindowStyleMask(ns.NSWindowStyleMaskTitled|ns.NSWindowStyleMaskClosable|
ns.NSWindowStyleMaskResizable),
ns.NSBackingStoreType(ns.NSBackingStoreBuffered),
0,
false,
)
// We do not need to retain this because we are in garbage collection mode
// and have assigned it to a global variable.
@@ -86,8 +86,8 @@ func didFinishLaunching(self ns.AppDelegate, n *ns.NSNotification) {
//add some layout constraints
b1.SetTranslatesAutoresizingMaskIntoConstraints(0)
b2.SetTranslatesAutoresizingMaskIntoConstraints(0)
b1.SetTranslatesAutoresizingMaskIntoConstraints(false)
b2.SetTranslatesAutoresizingMaskIntoConstraints(false)
cv := win.ContentView()
@@ -105,12 +105,12 @@ func didFinishLaunching(self ns.AppDelegate, n *ns.NSNotification) {
cv.AddConstraints(ns.NSLayoutConstraintsWithVisualFormat(
nst("H:[b1]-[b2]"), ns.NSLayoutFormatOptions(ns.NSLayoutFormatAlignAllBaseline), nil, viewmap))
a.ActivateIgnoringOtherApps(1)
a.ActivateIgnoringOtherApps(true)
}
func shouldTerminateAfterLastWindowClosed(self ns.AppDelegate, s *ns.NSApplication) ns.BOOL {
fmt.Println("Go: should terminate after last window closed")
return 1
return true
}
func willTerminate(self ns.AppDelegate, n *ns.NSNotification) {
+2 -2
View File
@@ -10,7 +10,7 @@ import (
"time"
)
func updateState(self ns.CBDelegate, c *ns.CBCentralManager, b bool) {
func updateState(self ns.CBDelegate, c *ns.CBCentralManager) {
fmt.Printf("Go: did update state\n")
switch ns.NSInteger(cm.CBManager.State()) {
case ns.CBManagerStateUnknown:
@@ -107,7 +107,7 @@ func discoverCharacteristics(self ns.CBDelegate, p *ns.CBPeripheral, s *ns.CBSer
chuuid := chr.UUID()
fmt.Printf("------%s\n", chuuid.UUIDString())
if chuuid.IsEqualTo(hrv_uuid) {
p.SetNotifyValue(1, chr)
p.SetNotifyValue((ns.BOOL)(true), chr)
v := chr.Value()
fmt.Println(hr(v))
}
+2 -2
View File
@@ -110,7 +110,7 @@ func main() {
fmt.Printf("Length of oarr is %d\n", len(oarr))
karr := make([]*ns.Id, 0, 5)
fmt.Printf("\nGetObjectsAndKeysCount()\n")
d.GetObjectsAndKeysCount(&oarr, &karr, 4)
d.GetObjectsAndKeys(&oarr, &karr, 4)
fmt.Printf("Length of oarr is now %d\n", len(oarr))
for i, k := range karr {
fmt.Printf("-- %s -> %s\n", k.NSString(), oarr[i].NSString())
@@ -150,7 +150,7 @@ func main() {
ost := make([]*ns.NSString, 0, 1)
oar := make([]*ns.NSArray, 0, 1)
fmt.Printf("\nCompletePathIntoString()\n")
i := path.CompletePathIntoString(&ost, 0, &oar, filter)
i := path.CompletePathIntoString(&ost, false, &oar, filter)
fmt.Printf("%d matches\n", i)
if i > 0 {
fmt.Printf("ost = %s\n", ost[0])
-58
View File
@@ -1,58 +0,0 @@
package ns
/*
#cgo CFLAGS: -x objective-c -fno-objc-arc
#cgo LDFLAGS: -framework Foundation
#pragma clang diagnostic ignored "-Wformat-security"
#import <Foundation/Foundation.h>
*/
import "C"
import (
"unsafe"
)
//export C1Dealloc
func C1Dealloc(o unsafe.Pointer) {
C1Mux.RLock()
cb := C1Lookup[o].Dealloc
C1Mux.RUnlock()
if cb == nil { return }
self := C1{}
self.ptr = o
super := C1Supermethods{
self.SuperDealloc,
self.SuperRelease,
}
cb(self, super)
}
//export C1Release
func C1Release(o unsafe.Pointer) {
C1Mux.RLock()
cb := C1Lookup[o].Release
C1Mux.RUnlock()
if cb == nil { return }
self := C1{}
self.ptr = o
super := C1Supermethods{
self.SuperDealloc,
self.SuperRelease,
}
cb(self, super)
}
//export C2MyMethod
func C2MyMethod(o unsafe.Pointer) {
C2Mux.RLock()
cb := C2Lookup[o].MyMethod
C2Mux.RUnlock()
if cb == nil { return }
self := C2{}
self.ptr = o
cb(self)
}
File diff suppressed because it is too large Load Diff
Binary file not shown.