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
ef4ddd63
Commit
ef4ddd63
authored
Jul 07, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
another piece for cross-file forward struct declarations.
R=ken OCL=31233 CL=31233
parent
a14b28a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
dcl.c
src/cmd/gc/dcl.c
+14
-1
No files found.
src/cmd/gc/dcl.c
View file @
ef4ddd63
...
...
@@ -67,11 +67,23 @@ dodcltype(Type *n)
// if n has been forward declared,
// use the Type* created then
s
=
n
->
sym
;
if
(
s
->
block
==
block
&&
s
->
def
!=
N
&&
s
->
def
->
op
==
OTYPE
)
{
if
(
(
funcdepth
==
0
||
s
->
block
==
block
)
&&
s
->
def
!=
N
&&
s
->
def
->
op
==
OTYPE
)
{
switch
(
s
->
def
->
type
->
etype
)
{
case
TFORWSTRUCT
:
case
TFORWINTER
:
n
=
s
->
def
->
type
;
if
(
s
->
block
!=
block
)
{
// completing forward struct from other file
Dcl
*
d
,
*
r
;
d
=
dcl
();
d
->
dsym
=
s
;
d
->
dtype
=
n
;
d
->
op
=
OTYPE
;
r
=
externdcl
;
d
->
back
=
r
->
back
;
r
->
back
->
forw
=
d
;
r
->
back
=
d
;
}
goto
found
;
}
}
...
...
@@ -109,6 +121,7 @@ updatetype(Type *n, Type *t)
yyerror
(
"%T forward declared as struct"
,
n
);
return
;
}
n
->
local
=
1
;
break
;
case
TFORWINTER
:
...
...
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