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
14a74378
Commit
14a74378
authored
Jan 13, 2010
by
Devon H. O'Dell
Committed by
Russ Cox
Jan 13, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgo: handle C99 bool type
Fixes #307. R=rsc CC=golang-dev
https://golang.org/cl/186073
parent
84ac357c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
gcc.go
src/cmd/cgo/gcc.go
+7
-1
No files found.
src/cmd/cgo/gcc.go
View file @
14a74378
...
...
@@ -329,6 +329,7 @@ type typeConv struct {
typedef
map
[
string
]
ast
.
Expr
// Predeclared types.
bool
ast
.
Expr
byte
ast
.
Expr
// denotes padding
int8
,
int16
,
int32
,
int64
ast
.
Expr
uint8
,
uint16
,
uint32
,
uint64
,
uintptr
ast
.
Expr
...
...
@@ -346,6 +347,7 @@ func (c *typeConv) Init(ptrSize int64) {
c
.
ptrSize
=
ptrSize
c
.
m
=
make
(
map
[
dwarf
.
Type
]
*
Type
)
c
.
typedef
=
make
(
map
[
string
]
ast
.
Expr
)
c
.
bool
=
c
.
Ident
(
"bool"
)
c
.
byte
=
c
.
Ident
(
"byte"
)
c
.
int8
=
c
.
Ident
(
"int8"
)
c
.
int16
=
c
.
Ident
(
"int16"
)
...
...
@@ -443,6 +445,10 @@ func (c *typeConv) Type(dtype dwarf.Type) *Type {
gt
.
Elt
=
sub
.
Go
t
.
C
=
fmt
.
Sprintf
(
"typeof(%s[%d])"
,
sub
.
C
,
dt
.
Count
)
case
*
dwarf
.
BoolType
:
t
.
Go
=
c
.
bool
t
.
Align
=
c
.
ptrSize
case
*
dwarf
.
CharType
:
if
t
.
Size
!=
1
{
fatal
(
"unexpected: %d-byte char type - %s"
,
t
.
Size
,
dtype
)
...
...
@@ -613,7 +619,7 @@ func (c *typeConv) Type(dtype dwarf.Type) *Type {
}
switch
dtype
.
(
type
)
{
case
*
dwarf
.
AddrType
,
*
dwarf
.
CharType
,
*
dwarf
.
IntType
,
*
dwarf
.
FloatType
,
*
dwarf
.
UcharType
,
*
dwarf
.
UintType
:
case
*
dwarf
.
AddrType
,
*
dwarf
.
BoolType
,
*
dwarf
.
CharType
,
*
dwarf
.
IntType
,
*
dwarf
.
FloatType
,
*
dwarf
.
UcharType
,
*
dwarf
.
UintType
:
s
:=
dtype
.
Common
()
.
Name
if
s
!=
""
{
if
ss
,
ok
:=
cnameMap
[
s
];
ok
{
...
...
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