Browse Source

vendor: Patch github.com/syncthing/notify for Go 1.11

Jakob Borg 7 years ago
parent
commit
500e02cdbb

+ 3 - 3
vendor/github.com/syncthing/notify/watcher_fsevents_cgo.go

@@ -48,7 +48,7 @@ var wg sync.WaitGroup      // used to wait until the runloop starts
 // started and is ready via the wg. It also serves purpose of a dummy source,
 // thanks to it the runloop does not return as it also has at least one source
 // registered.
-var source = C.CFRunLoopSourceCreate(nil, 0, &C.CFRunLoopSourceContext{
+var source = C.CFRunLoopSourceCreate(refZero, 0, &C.CFRunLoopSourceContext{
 	perform: (C.CFRunLoopPerformCallBack)(C.gosource),
 })
 
@@ -166,8 +166,8 @@ func (s *stream) Start() error {
 		return nil
 	}
 	wg.Wait()
-	p := C.CFStringCreateWithCStringNoCopy(nil, C.CString(s.path), C.kCFStringEncodingUTF8, nil)
-	path := C.CFArrayCreate(nil, (*unsafe.Pointer)(unsafe.Pointer(&p)), 1, nil)
+	p := C.CFStringCreateWithCStringNoCopy(refZero, C.CString(s.path), C.kCFStringEncodingUTF8, refZero)
+	path := C.CFArrayCreate(refZero, (*unsafe.Pointer)(unsafe.Pointer(&p)), 1, nil)
 	ctx := C.FSEventStreamContext{}
 	ref := C.EventStreamCreate(&ctx, C.uintptr_t(s.info), path, C.FSEventStreamEventId(atomic.LoadUint64(&since)), latency, flags)
 	if ref == nilstream {

+ 14 - 0
vendor/github.com/syncthing/notify/watcher_fsevents_go1.10.go

@@ -0,0 +1,14 @@
+// Copyright (c) 2018 The Notify Authors. All rights reserved.
+// Use of this source code is governed by the MIT license that can be
+// found in the LICENSE file.
+
+// +build darwin,!kqueue,cgo,!go1.11
+
+package notify
+
+/*
+ #include <CoreServices/CoreServices.h>
+*/
+import "C"
+
+var refZero = (*C.struct___CFAllocator)(nil)

+ 9 - 0
vendor/github.com/syncthing/notify/watcher_fsevents_go1.11.go

@@ -0,0 +1,9 @@
+// Copyright (c) 2018 The Notify Authors. All rights reserved.
+// Use of this source code is governed by the MIT license that can be
+// found in the LICENSE file.
+
+// +build darwin,!kqueue,go1.11
+
+package notify
+
+const refZero = 0

+ 2 - 2
vendor/manifest

@@ -411,8 +411,8 @@
 			"importpath": "github.com/syncthing/notify",
 			"repository": "https://github.com/syncthing/notify",
 			"vcs": "git",
-			"revision": "cdf89c4039d13726e227d0a472053ea19de021b4",
-			"branch": "master",
+			"revision": "276f739c14a87f1473de6cb6aed215c843cb51a0",
+			"branch": "fixed",
 			"notests": true
 		},
 		{