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

This commit is contained in:
Jakob Borg 2018-08-06 20:15:43 +02:00
parent 82c9e23206
commit 500e02cdbb
4 changed files with 28 additions and 5 deletions

View File

@ -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 {

View File

@ -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)

View File

@ -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

4
vendor/manifest vendored
View File

@ -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
},
{