Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(886)

Delta Between Two Patch Sets: src/cmd/cgo/out.go

Issue 9738047: code review 9738047: runtime: Add shared library support (linux/amd64)
Left Patch Set: diff -r 39a7093ee8db69539235d88e325df1dbabd82cc5 https://go.googlecode.com/hg/ Created 10 years, 9 months ago
Right Patch Set: diff -r 3833ddddde2b1a2741a396c4e965b04d525a133b https://go.googlecode.com/hg/ Created 10 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « misc/cgo/testshared/test.bash ('k') | src/pkg/runtime/asm_386.s » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package main 5 package main
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "debug/elf" 9 "debug/elf"
10 "debug/macho" 10 "debug/macho"
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 487
488 if *gccgo { 488 if *gccgo {
489 p.writeGccgoOutputFunc(fgcc, n) 489 p.writeGccgoOutputFunc(fgcc, n)
490 return 490 return
491 } 491 }
492 492
493 ctype, _ := p.structType(n) 493 ctype, _ := p.structType(n)
494 494
495 // Gcc wrapper unpacks the C argument struct 495 // Gcc wrapper unpacks the C argument struct
496 // and calls the actual C function. 496 // and calls the actual C function.
497 » fmt.Fprintf(fgcc, "void\n") 497 » fmt.Fprintf(fgcc, "__attribute__ ((visibility (\"hidden\"))) void\n")
498 fmt.Fprintf(fgcc, "_cgo%s%s(void *v)\n", cPrefix, n.Mangle) 498 fmt.Fprintf(fgcc, "_cgo%s%s(void *v)\n", cPrefix, n.Mangle)
499 fmt.Fprintf(fgcc, "{\n") 499 fmt.Fprintf(fgcc, "{\n")
500 if n.AddError { 500 if n.AddError {
501 fmt.Fprintf(fgcc, "\terrno = 0;\n") 501 fmt.Fprintf(fgcc, "\terrno = 0;\n")
502 } 502 }
503 // We're trying to write a gcc struct that matches 6c/8c/5c's layout. 503 // We're trying to write a gcc struct that matches 6c/8c/5c's layout.
504 // Use packed attribute to force no padding in this struct in case 504 // Use packed attribute to force no padding in this struct in case
505 // gcc has different packing requirements. For example, 505 // gcc has different packing requirements. For example,
506 // on 386 Windows, gcc wants to 8-align int64s, but 8c does not. 506 // on 386 Windows, gcc wants to 8-align int64s, but 8c does not.
507 // Use __gcc_struct__ to work around http://gcc.gnu.org/PR52991 on x86, 507 // Use __gcc_struct__ to work around http://gcc.gnu.org/PR52991 on x86,
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
1215 typedef double GoFloat64; 1215 typedef double GoFloat64;
1216 typedef __complex float GoComplex64; 1216 typedef __complex float GoComplex64;
1217 typedef __complex double GoComplex128; 1217 typedef __complex double GoComplex128;
1218 1218
1219 typedef struct { char *p; GoInt n; } GoString; 1219 typedef struct { char *p; GoInt n; } GoString;
1220 typedef void *GoMap; 1220 typedef void *GoMap;
1221 typedef void *GoChan; 1221 typedef void *GoChan;
1222 typedef struct { void *t; void *v; } GoInterface; 1222 typedef struct { void *t; void *v; } GoInterface;
1223 typedef struct { void *data; GoInt len; GoInt cap; } GoSlice; 1223 typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
1224 ` 1224 `
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b