Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
fb12ad06
Commit
fb12ad06
authored
Oct 30, 2009
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix build
R=agl CC=rsc
http://go/go-review/1016008
parent
1e984cb9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
out.go
src/cmd/cgo/out.go
+4
-4
No files found.
src/cmd/cgo/out.go
View file @
fb12ad06
...
...
@@ -37,7 +37,7 @@ func (p *Prog) writeOutput(srcfile string) {
// Write Go output: Go input with rewrites of C.xxx to _C_xxx.
fmt
.
Fprintf
(
fgo1
,
"// Created by cgo - DO NOT EDIT
\n
"
);
fmt
.
Fprintf
(
fgo1
,
"//line %s:1
\n
"
,
srcfile
);
printer
.
Fprint
(
fgo1
,
p
.
AST
,
0
,
8
,
nil
);
printer
.
Fprint
(
fgo1
,
p
.
AST
);
// Write second Go output: definitions of _C_xxx.
// In a separate file so that the import of "unsafe" does not
...
...
@@ -49,7 +49,7 @@ func (p *Prog) writeOutput(srcfile string) {
for
name
,
def
:=
range
p
.
Typedef
{
fmt
.
Fprintf
(
fgo2
,
"type %s "
,
name
);
printer
.
Fprint
(
fgo2
,
def
,
0
,
8
,
nil
);
printer
.
Fprint
(
fgo2
,
def
);
fmt
.
Fprintf
(
fgo2
,
"
\n
"
);
}
fmt
.
Fprintf
(
fgo2
,
"type _C_void [0]byte
\n
"
);
...
...
@@ -64,7 +64,7 @@ func (p *Prog) writeOutput(srcfile string) {
for
name
,
def
:=
range
p
.
Vardef
{
fmt
.
Fprintf
(
fc
,
"#pragma dynld %s·_C_%s %s
\"
%s/%s_%s.so
\"\n
"
,
p
.
Package
,
name
,
name
,
pkgroot
,
p
.
PackagePath
,
base
);
fmt
.
Fprintf
(
fgo2
,
"var _C_%s "
,
name
);
printer
.
Fprint
(
fgo2
,
&
ast
.
StarExpr
{
X
:
def
.
Go
}
,
0
,
8
,
nil
);
printer
.
Fprint
(
fgo2
,
&
ast
.
StarExpr
{
X
:
def
.
Go
});
fmt
.
Fprintf
(
fgo2
,
"
\n
"
);
}
fmt
.
Fprintf
(
fc
,
"
\n
"
);
...
...
@@ -75,7 +75,7 @@ func (p *Prog) writeOutput(srcfile string) {
Name
:
&
ast
.
Ident
{
Value
:
"_C_"
+
name
},
Type
:
def
.
Go
,
};
printer
.
Fprint
(
fgo2
,
d
,
0
,
8
,
nil
);
printer
.
Fprint
(
fgo2
,
d
);
fmt
.
Fprintf
(
fgo2
,
"
\n
"
);
if
name
==
"CString"
||
name
==
"GoString"
{
...
...
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