From 500e02cdbb5f7ff87f63664a7b501a6492e8fb12 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Mon, 6 Aug 2018 20:15:43 +0200 Subject: [PATCH] vendor: Patch github.com/syncthing/notify for Go 1.11 --- .../syncthing/notify/watcher_fsevents_cgo.go | 6 +++--- .../syncthing/notify/watcher_fsevents_go1.10.go | 14 ++++++++++++++ .../syncthing/notify/watcher_fsevents_go1.11.go | 9 +++++++++ vendor/manifest | 4 ++-- 4 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 vendor/github.com/syncthing/notify/watcher_fsevents_go1.10.go create mode 100644 vendor/github.com/syncthing/notify/watcher_fsevents_go1.11.go diff --git a/vendor/github.com/syncthing/notify/watcher_fsevents_cgo.go b/vendor/github.com/syncthing/notify/watcher_fsevents_cgo.go index 17f7a9ee..95ee7044 100644 --- a/vendor/github.com/syncthing/notify/watcher_fsevents_cgo.go +++ b/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 { diff --git a/vendor/github.com/syncthing/notify/watcher_fsevents_go1.10.go b/vendor/github.com/syncthing/notify/watcher_fsevents_go1.10.go new file mode 100644 index 00000000..dd2433d2 --- /dev/null +++ b/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 +*/ +import "C" + +var refZero = (*C.struct___CFAllocator)(nil) diff --git a/vendor/github.com/syncthing/notify/watcher_fsevents_go1.11.go b/vendor/github.com/syncthing/notify/watcher_fsevents_go1.11.go new file mode 100644 index 00000000..92b406ce --- /dev/null +++ b/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 diff --git a/vendor/manifest b/vendor/manifest index d2e1df77..36cc6207 100644 --- a/vendor/manifest +++ b/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 }, {