On Wed, Sep 9, 2020 at 1:09 PM 'Dan Kortschak' via golang-nuts <
golang-nuts@googlegroups.com> wrote:

> What does cgo -godefs give you? On my amd64 and arm64 I get this:
>
> ```
> ~/cznic $ cat main.go
> package main
>
> /*
> struct s {
>         long long i;
> } x;
> */
> import "C"
>
> type S struct {
>         i int64
> }
>
> type C_s C.struct_s
>
> ~/cznic $ go tool cgo -godefs main.go
> // Code generated by cmd/cgo -godefs; DO NOT EDIT.
> // cgo -godefs main.go
>
> package main
>
> type S struct {
>         i int64
> }
>
> type C_s struct {
>         I int64
> }
> ```

amd64
=========================================================================

jnml@e5-1650:~/tmp$ go version
go version go1.15.1 linux/amd64
jnml@e5-1650:~/tmp$ cat main.go
package main

/*
struct s {
        long long i;
} x;
*/
import "C"

type S struct {
        i int64
}

type C_s C.struct_s
jnml@e5-1650:~/tmp$ go tool cgo -godefs main.go
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs main.go

package main

type S struct {
        i int64
}

type C_s struct {
        I int64
}
jnml@e5-1650:~/tmp$

arm
===========================================================================

pi@raspberrypi:~/src/tmp.tmp $ go version
go version go1.15.1 linux/arm
pi@raspberrypi:~/src/tmp.tmp $ cat main.go
package main

/*
struct s {
        long long i;
} x;
*/
import "C"

type S struct {
        i int64
}

type C_s C.struct_s
pi@raspberrypi:~/src/tmp.tmp $ go tool cgo -godefs main.go
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs main.go

package main

type S struct {
        i int64
}

type C_s struct {
        I int64
}
pi@raspberrypi:~/src/tmp.tmp $

No difference between the outputs AFAICT. Seems good to me.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAA40n-Xj22QAWdU-CjxibUhBEwxChm-HOORUUxbpfG2ihY0Sjg%40mail.gmail.com.

Reply via email to