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
cfefe6a7
Commit
cfefe6a7
authored
Jul 12, 2013
by
Keith Randall
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/dist: allow assembly code to use enumerated constants.
R=golang-dev, rsc CC=golang-dev
https://golang.org/cl/11056044
parent
8124a02c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
src/cmd/dist/buildruntime.c
src/cmd/dist/buildruntime.c
+8
-1
No files found.
src/cmd/dist/buildruntime.c
View file @
cfefe6a7
...
...
@@ -234,10 +234,11 @@ ok:
// Gobuf 24 sched;
// 'Y' 48 stack0;
// }
// StackMin = 128;
// into output like
// #define g_sched 24
// #define g_stack0 48
//
//
#define const_StackMin 128
aggr
=
nil
;
splitlines
(
&
lines
,
bstr
(
&
in
));
for
(
i
=
0
;
i
<
lines
.
len
;
i
++
)
{
...
...
@@ -265,6 +266,12 @@ ok:
p
[
xstrlen
(
p
)
-
1
]
=
'\0'
;
bwritestr
(
&
out
,
bprintf
(
&
b
,
"#define %s_%s %s
\n
"
,
aggr
,
fields
.
p
[
n
-
1
],
fields
.
p
[
n
-
2
]));
}
if
(
fields
.
len
==
3
&&
streq
(
fields
.
p
[
1
],
"="
))
{
// generated from enumerated constants
p
=
fields
.
p
[
2
];
if
(
p
[
xstrlen
(
p
)
-
1
]
==
';'
)
p
[
xstrlen
(
p
)
-
1
]
=
'\0'
;
bwritestr
(
&
out
,
bprintf
(
&
b
,
"#define const_%s %s
\n
"
,
fields
.
p
[
0
],
p
));
}
}
// Some #defines that are used for .c files.
...
...
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