Skip to content

use C.kCFAllocatorDefault instead of refZero#162

Merged
rjeczalik merged 1 commit intorjeczalik:masterfrom
nonsense:remove-refZero
Aug 27, 2018
Merged

use C.kCFAllocatorDefault instead of refZero#162
rjeczalik merged 1 commit intorjeczalik:masterfrom
nonsense:remove-refZero

Conversation

@nonsense
Copy link
Copy Markdown
Contributor

This PR is removing refZero and using C.kCFAllocatorDefault instead, which according to golang/text@572a2b1 and https://developer.apple.com/documentation/corefoundation/kcfallocatordefault is defined as NULL.

Current version does not compile under go version go1.10.4 darwin/amd64 and throws:

vendor/github.com/rjeczalik/notify/watcher_fsevents_cgo.go:51: cannot use refZero (type *_Ctype_struct___CFAllocator) as type _Ctype_CFAllocatorRef in argument to func literal
vendor/github.com/rjeczalik/notify/watcher_fsevents_cgo.go:169: cannot use refZero (type *_Ctype_struct___CFAllocator) as type _Ctype_CFAllocatorRef in argument to func literal
vendor/github.com/rjeczalik/notify/watcher_fsevents_cgo.go:170: cannot use refZero (type *_Ctype_struct___CFAllocator) as type _Ctype_CFAllocatorRef in argument to func literal

See: https://travis-ci.org/ethereum/go-ethereum/jobs/421003255#L164

@imsodin
Copy link
Copy Markdown
Contributor

imsodin commented Aug 27, 2018

Did you check if it works with Go1.11?

@nonsense
Copy link
Copy Markdown
Contributor Author

@imsodin yes, I checked, and this PR works with Go1.11 and Go1.10.4.

Actually current master (4e54e7f) works fine with Go1.11, however it doesn't work with Go1.10.4.

@rjeczalik rjeczalik merged commit 0f065fa into rjeczalik:master Aug 27, 2018
@rjeczalik
Copy link
Copy Markdown
Owner

Thanks @nonsense for the PR! I did know about C.kCFAllocatorDefault.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants