Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: how to use cgo -godefs #2800

Closed
rsc opened this issue Jan 27, 2012 · 1 comment
Closed

cmd/go: how to use cgo -godefs #2800

rsc opened this issue Jan 27, 2012 · 1 comment

Comments

@rsc
Copy link
Contributor

rsc commented Jan 27, 2012

[Not entirely sure what this is asking.]

Comment #9 of issue #2606.

Another small issue, I didn't find a way to use `cgo -godefs` using this tool (grep'ed
for 'godefs' in goinstall/go cmds and go/build package).

I have a nasty struct in my C bindings:
typedef struct {
    unsigned long        index;
    double               x;
    double               y;
} cairo_glyph_t;

unsigned long is 4 bytes on x86, 8 bytes on x86_64. Also wiki says: "A double
(eight bytes) will be 8-byte aligned on Windows and 4-byte aligned on Linux (8-byte with
-malign-double compile time option)", which is kind of scary.
@rsc
Copy link
Contributor Author

rsc commented Sep 12, 2012

Comment 1:

There is no way to invoke cgo -godefs during the build. Importing C should be possible
though.

Status changed to WorkingAsIntended.

@rsc rsc self-assigned this Sep 12, 2012
@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants