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

Delta Between Two Patch Sets: src/cmd/dist/goc2c.c

Issue 5645093: code review 5645093: cmd/dist: cross-compiling fixes (Closed)
Left Patch Set: Created 13 years, 1 month ago
Right Patch Set: diff -r aa8737f1a31b https://go.googlecode.com/hg/ Created 13 years, 1 month 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 | « src/cmd/dist/buildruntime.c ('k') | src/cmd/dist/unix.c » ('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 #include "a.h" 5 #include "a.h"
6 6
7 /* 7 /*
8 * Translate a .goc file into a .c file. A .goc file is a combination 8 * Translate a .goc file into a .c file. A .goc file is a combination
9 * of a limited form of Go with C. 9 * of a limited form of Go with C.
10 */ 10 */
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 Buf in, out; 702 Buf in, out;
703 ········ 703 ········
704 binit(&in); 704 binit(&in);
705 binit(&out); 705 binit(&out);
706 ········ 706 ········
707 file = goc; 707 file = goc;
708 readfile(&in, goc); 708 readfile(&in, goc);
709 709
710 // TODO: set gcc=1 when using gcc 710 // TODO: set gcc=1 when using gcc
711 711
712 » if(!gcc && streq(goarch, "amd64")) { 712 » if(!gcc) {
713 » » type_table[Uintptr].size = 8; 713 » » if(streq(goarch, "amd64")) {
714 » » type_table[String].size = 16; 714 » » » type_table[Uintptr].size = 8;
715 » » type_table[Slice].size = 8+4+4; 715 » » » type_table[String].size = 16;
716 » » type_table[Eface].size = 8+8; 716 » » » type_table[Slice].size = 8+4+4;
717 » » structround = 8; 717 » » » type_table[Eface].size = 8+8;
718 » } 718 » » » structround = 8;
719 719 » » } else {
720 » bprintf(&out, "// auto generated by go tool dist\n\n"); 720 » » » type_table[Uintptr].size = 4;
721 » » » type_table[String].size = 8;
722 » » » type_table[Slice].size = 16;
723 » » » type_table[Eface].size = 4+4;
724 » » » structround = 4;
725 » » }
726 » }
727
728 » bprintf(&out, "// auto generated by go tool dist\n// goos=%s goarch=%s\n \n", goos, goarch);
721 input = bstr(&in); 729 input = bstr(&in);
722 output = &out; 730 output = &out;
723 731
724 process_file(); 732 process_file();
725 ········ 733 ········
726 writefile(&out, c); 734 writefile(&out, c);
727 } 735 }
LEFTRIGHT

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