Re: [go-nuts] cgo: undefined reference to `stdout'

2016-07-31 Thread andrey mirtchovski
this is bug 10715: https://github.com/golang/go/issues/10715 a more idiomatic solution is available here: https://github.com/golang/go/blob/master/misc/cgo/stdio/stdio.go On Sun, Jul 31, 2016 at 1:22 AM, P Q wrote: > https://play.golang.org/p/4XZSmyRkZa > > I've got

Re: [go-nuts] Compiling C files conditionally

2016-07-30 Thread andrey mirtchovski
there are a few problems with your project as presented: - your .c file has a (mistyped) directive to not build on linux on line 1: "/ build !linux". this needs to go - your a_non_linux.go file is not idiomatic. it makes much more sense to specialize the linux code in a separate file and leave

Re: [go-nuts] Re: why treat int and []int differently here?

2016-07-17 Thread andrey mirtchovski
> @all, thanks for the explanation! in my view, all the "details" come from reasoning about Go through the sieve of other programming languages. nothing wrong in doing that, as long as the original intention is understood. for me, Go will always be looked through the sieve of C, in particular the

Re: [go-nuts] export struct method to C-code as callback (cgo-related)

2016-06-17 Thread andrey mirtchovski
If the library made no provision for the caller to give a unique token which would help to identify it in the callback then that library does not expect to have more than one caller-and-callback in play at any one time, or, even worse, expects you to arrange some thread-local storage in the caller

<    1   2   3