Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
441e775d
Commit
441e775d
authored
Nov 05, 2009
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gofmt'ed godefs
R=rsc
http://go/go-review/1020001
parent
6a4940ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
src/cmd/godefs/doc.go
src/cmd/godefs/doc.go
+11
-11
No files found.
src/cmd/godefs/doc.go
View file @
441e775d
...
...
@@ -6,7 +6,7 @@
Godefs is a bootstrapping tool for porting the Go runtime to new systems.
It translates C type declarations into C or Go type declarations
with the same memory layout.
with the same memory layout.
Usage: godefs [-g package] [-c cc] [-f cc-arg]... [defs.c ...]
...
...
@@ -18,13 +18,13 @@ definitions.
The input to godefs is a C input file that can be compiled by
the host system's standard C compiler (typically gcc).
This file is expected to define new types and enumerated constants
whose names begin with $ (a legal identifier character in gcc).
whose names begin with $ (a legal identifier character in gcc).
Godefs compile the given input file with the host compiler and
then parses the debug info embedded in the assembly output.
This is far easier than reading system headers on most machines.
The output from godefs is either C output intended for the
Plan 9 C compiler tool chain (6c, 8c, or 5c) or Go output.
Plan 9 C compiler tool chain (6c, 8c, or 5c) or Go output.
The options are:
...
...
@@ -35,7 +35,7 @@ The options are:
-c cc
set the name of the host system's C compiler (default "gcc")
-f cc-arg
add cc-arg to the command line when invoking the system C compiler
(for example, -f -m64 to invoke gcc -m64).
...
...
@@ -56,17 +56,17 @@ then "godefs x.c" generates:
// godefs x.c
// MACHINE GENERATED - DO NOT EDIT.
// Constants
enum {
S_IFMT = 0xf000,
S_IFIFO = 0x1000,
S_IFCHR = 0x2000,
};
// Types
#pragma pack on
typedef struct Timespec Timespec;
struct Timespec {
int64 tv_sec;
...
...
@@ -78,18 +78,18 @@ and "godefs -g MyPackage x.c" generates:
// godefs -g MyPackage x.c
// MACHINE GENERATED - DO NOT EDIT.
package MyPackage
// Constants
const (
S_IFMT = 0xf000;
S_IFIFO = 0x1000;
S_IFCHR = 0x2000;
)
// Types
type Timespec struct {
Sec int64;
Nsec int64;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment