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

Delta Between Two Patch Sets: src/pkg/go/build/build.go

Issue 8248043: code review 8248043: cmd/go: Add support for including C++ files in packages (Closed)
Left Patch Set: diff -r 8633d8460c82 https://code.google.com/p/go Created 10 years, 11 months ago
Right Patch Set: diff -r e86ab7e59e50 https://code.google.com/p/go Created 10 years, 10 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/cmd/godoc/index.go ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2011 The Go Authors. All rights reserved. 1 // Copyright 2011 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 build 5 package build
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "errors" 9 "errors"
10 "fmt" 10 "fmt"
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 return false // this one doesn't match 850 return false // this one doesn't match
851 } 851 }
852 } 852 }
853 } 853 }
854 } 854 }
855 } 855 }
856 return true // everything matches 856 return true // everything matches
857 } 857 }
858 858
859 // saveCgo saves the information from the #cgo lines in the import "C" comment. 859 // saveCgo saves the information from the #cgo lines in the import "C" comment.
860 // These lines set CPP, CFLAGS, FXXFLAGS and LDFLAGS and pkg-config directives 860 // These lines set CPPCFLAGS, CFLAGS, CXXFLAGS and LDFLAGS and pkg-config direct ives
861 // that affect the way cgo's C code is built. 861 // that affect the way cgo's C code is built.
862 // 862 //
863 // TODO(rsc): This duplicates code in cgo. 863 // TODO(rsc): This duplicates code in cgo.
864 // Once the dust settles, remove this code from cgo. 864 // Once the dust settles, remove this code from cgo.
865 func (ctxt *Context) saveCgo(filename string, di *Package, cg *ast.CommentGroup) error { 865 func (ctxt *Context) saveCgo(filename string, di *Package, cg *ast.CommentGroup) error {
866 text := cg.Text() 866 text := cg.Text()
867 for _, line := range strings.Split(text, "\n") { 867 for _, line := range strings.Split(text, "\n") {
868 orig := line 868 orig := line
869 869
870 // Line is 870 // Line is
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 switch goarch { 1124 switch goarch {
1125 case "386": 1125 case "386":
1126 return "8", nil 1126 return "8", nil
1127 case "amd64": 1127 case "amd64":
1128 return "6", nil 1128 return "6", nil
1129 case "arm": 1129 case "arm":
1130 return "5", nil 1130 return "5", nil
1131 } 1131 }
1132 return "", errors.New("unsupported GOARCH " + goarch) 1132 return "", errors.New("unsupported GOARCH " + goarch)
1133 } 1133 }
LEFTRIGHT

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