summaryrefslogtreecommitdiff
path: root/src/cmd/cgo
AgeCommit message (Collapse)AuthorFilesLines
2011-06-30Imported Upstream version 58upstream/58Ondřej Surý3-31/+119
2011-04-28Imported Upstream version 2011.04.27upstream/2011.04.27Ondřej Surý2-42/+52
2011-04-26Imported Upstream version 2011.04.13upstream/2011.04.13Ondřej Surý5-56/+58
2011-04-20Imported Upstream version 2011.03.07.1upstream/2011.03.07.1Ondřej Surý3-70/+103
2011-02-18Imported Upstream version 2011.02.15upstream/2011.02.15Ondřej Surý3-15/+54
2011-02-14Imported Upstream version 2011-02-01.1upstream/2011-02-01.1Ondřej Surý5-30/+197
2011-01-17Imported Upstream version 2011.01.12upstream/2011.01.12Ondřej Surý7-683/+1183
2010-07-01strings and bytes.Split: make count of 0 mean 0, not infinite.Rob Pike1-3/+3
Use a count of -1 for infinity. Ditto for Replace. R=rsc CC=golang-dev http://codereview.appspot.com/1704044 Committer: Rob Pike <r@golang.org>
2010-06-30cgo: use slash-free relative paths for .so referencesRuss Cox1-8/+24
The Makefile and cgo now rewrite / to _ when creating the path. The .so for gosqlite.googlecode.com/hg/sqlite is named cgo_gosqlite.googlecode.com_hg_sqlite.so, and then 6l and 8l both include a default rpath of $GOROOT/pkg/$GOOS_$GOARCH. This should make it easier to move binaries from one system to another. Fixes issue 857. R=iant, r CC=golang-dev http://codereview.appspot.com/1700048
2010-05-30Correct _cgo_free when C ABI does not pass first arg on stack.Ian Lance Taylor1-1/+1
It turns out that _cgo_malloc is used, via cmalloc in runtime/cgocall.c, which is called by code generated by out.go for the ·_C_CString function. I can't find a call to _cgo_free, but given _cgo_malloc we might as well keep _cgo_free. This patch fixes it so that it should work on amd64. R=rsc CC=golang-dev http://codereview.appspot.com/1399041
2010-05-21roll back 1193046 - fix buildRuss Cox1-5/+0
R=dho CC=golang-dev http://codereview.appspot.com/1257043
2010-05-21cgo: better error for no C symbolsDevon H. O'Dell1-0/+5
R=rsc, iant CC=golang-dev, graeme.perrow http://codereview.appspot.com/1193046 Committer: Russ Cox <rsc@golang.org>
2010-04-09Add //export to cgo.Ian Lance Taylor2-1/+352
The new //export comment marks a Go function as callable from C. The syntax is "//export NAME" where NAME is the name of the function as seen from C. If such a comment is seen, cgo will generate two new files: _cgo_export.h and _cgo_export.c. The _cgo_export.h file provides declarations which C code may use to call Go functions. The _cgo_export.c file contains wrappers, and is to be compiled with gcc. The changes to Make.pkg support using this from a Go Makefile, though it could probably be more convenient. R=rsc CC=golang-dev http://codereview.appspot.com/853042
2010-03-30single argument panicRuss Cox1-1/+1
note that sortmain.go has been run through hg gofmt; only the formatting of the day initializers changed. i'm happy to revert that formatting if you'd prefer. stop on error in doc/progs/run R=r CC=golang-dev http://codereview.appspot.com/850041
2010-03-22Rename dynld to dynimport throughout.Ian Lance Taylor1-6/+6
Cgo users will need to rerun cgo. R=rsc CC=golang-dev http://codereview.appspot.com/692041
2010-03-02gofmt: experiment: align values in map composites where possibleRobert Griesemer3-22/+22
- gofmt -w src misc - looking for feedback R=rsc, r CC=golang-dev http://codereview.appspot.com/223076
2010-02-25go/printer, gofmt: align comments in multi-line expression listsRobert Griesemer1-7/+7
- gofmt -w src misc - improves several lists and fixes minor degradation introduced with the fix for issue 628 - removed some dead code (stringList) R=rsc CC=golang-dev http://codereview.appspot.com/223058
2010-02-25strings: delete Runes, BytesRuss Cox1-2/+2
gofmt -w -r 'strings.Bytes(a) -> []byte(a)' src/cmd src/pkg test/bench gofmt -w -r 'strings.Runes(a) -> []int(a)' src/cmd src/pkg test/bench delete unused imports R=r CC=golang-dev http://codereview.appspot.com/224062
2010-02-24go/ast: streamline representation of field listsRobert Griesemer2-8/+10
- always include position information about opening/closing parens/braces - replace uses of []*ast.Field with *ast.FieldList Fixes issue 473. R=rsc CC=golang-dev http://codereview.appspot.com/223043
2010-02-19- removed exp/parser (support for old semicolon syntax)Robert Griesemer1-3/+2
- go/ast: removed StringList (not needed anymore) - go/ast: changed import path and field list tag to a single string - updated all dependencies R=rsc CC=golang-dev http://codereview.appspot.com/217056
2010-02-02Change type of Printf's args to ... interface{}Rob Pike1-2/+2
R=rsc CC=golang-dev http://codereview.appspot.com/197043
2010-01-27More steps towards tracking of identifier scopes.Robert Griesemer2-2/+2
- provide scope to parse functions; if non-nil, parser uses the scope to declare and lookup identifiers - resolve forward references where possible R=rsc CC=golang-dev http://codereview.appspot.com/194098
2010-01-26cgo: update for package global name spaceRuss Cox1-5/+5
Fixes issue 560. R=r CC=golang-dev http://codereview.appspot.com/195051
2010-01-15 Steps towards tracking scopes for identifiers.Robert Griesemer4-14/+14
- Identifiers refer now to the language entity (Object) that they denote. At the moment this is at best an approximation. - Initial data structures for language entities (Objects) and expression types (Type) independent of the actual type notations. - Initial support for declaring and looking up identifiers. - Updated various dependent files and added support functions. - Extensively tested to avoid breakage. This is an AST change. R=rsc CC=golang-dev, rog http://codereview.appspot.com/189080
2010-01-13cgo: Only allow numeric / string / character type constants for referencesDevon H. O'Dell1-1/+7
to #defined things. Fixes issue 520. R=rsc, rsaarelm CC=golang-dev http://codereview.appspot.com/186138 Committer: Russ Cox <rsc@golang.org>
2010-01-13cgo: handle C99 bool typeDevon H. O'Dell1-1/+7
Fixes issue 307. R=rsc CC=golang-dev http://codereview.appspot.com/186073 Committer: Russ Cox <rsc@golang.org>
2010-01-11 cgo: Make constants #define'd in C available to Go (as consts)Devon H. O'Dell4-3/+77
Fixes issue 435 R=rsc CC=golang-dev http://codereview.appspot.com/181161 Committer: Russ Cox <rsc@golang.org>
2010-01-06cgo: Use -fno-eliminate-unused-debug-types when calling gcc to for dwarf stabs.Devon H. O'Dell1-0/+1
This keeps debug symbols in for e.g. unreferenced enums. Fixes issue 479 R=rsc CC=golang-dev, waltermundt http://codereview.appspot.com/181102 Committer: Russ Cox <rsc@golang.org>
2010-01-04Simplified parser interface.Robert Griesemer1-1/+1
R=rsc, r CC=golang-dev, rog http://codereview.appspot.com/183116
2009-12-23cgo: don't overwrite p.CrefsDevon H. O'Dell1-1/+3
It's expected to be shared between all files so that all types are output. Fixes bug reported on mailing list by Peter Froehlich. R=rsc, phf CC=golang-dev http://codereview.appspot.com/183043 Committer: Russ Cox <rsc@golang.org>
2009-12-21cgo: interpret $CGOPKGDIR as absolute path if rootedRuss Cox2-4/+11
R=dho CC=golang-dev http://codereview.appspot.com/180099
2009-12-17cgo: include line number information to keep go/printer happyRuss Cox1-1/+2
Fixes issue 443. R=dho CC=golang-dev http://codereview.appspot.com/179095
2009-12-17Allow cgo to accept multiple .go inputs for a packageDevon H. O'Dell3-73/+153
Fixes issue 342. R=rsc CC=golang-dev http://codereview.appspot.com/179062 Committer: Russ Cox <rsc@golang.org>
2009-12-17Use BitSize instead of the field's type native ByteSize when calculatingDevon H. O'Dell1-0/+3
structs containing bitfields. Fixes issue 163. R=rsc CC=golang-dev http://codereview.appspot.com/180059 Committer: Russ Cox <rsc@golang.org>
2009-12-15This patch enables cgo utility to correctly convert enums in the C sourceMoriyoshi Koizumi4-29/+75
into consts in the resulting Go source. Previously known as issue 161047, which I deleted accidentally. Fixes issue 207. R=rsc http://codereview.appspot.com/166059 Committer: Russ Cox <rsc@golang.org>
2009-12-15 1) Change default gofmt default settings forRobert Griesemer5-473/+473
parsing and printing to new syntax. Use -oldparser to parse the old syntax, use -oldprinter to print the old syntax. 2) Change default gofmt formatting settings to use tabs for indentation only and to use spaces for alignment. This will make the code alignment insensitive to an editor's tabwidth. Use -spaces=false to use tabs for alignment. 3) Manually changed src/exp/parser/parser_test.go so that it doesn't try to parse the parser's source files using the old syntax (they have new syntax now). 4) gofmt -w src misc test/bench 1st set of files. R=rsc CC=agl, golang-dev, iant, ken2, r http://codereview.appspot.com/180047
2009-12-02move ReadFile, WriteFile, and ReadDir into a separate io/ioutil package.Rob Pike1-3/+3
this breaks the dependency of package io on package bytes. R=rsc CC=golang-dev http://codereview.appspot.com/163085
2009-11-29cgo: use C type void for opaque types if dwarf.Common().Type returns nothingEden Li1-0/+3
Ideally, the C name would come from the typedef or pointer that references the Size<0 type, but we can't easily generate this without performing a look-ahead to see if any referencing type will become opaque. Fixes issue 334. Fixes issue 281. R=rsc http://codereview.appspot.com/161056 Committer: Russ Cox <rsc@golang.org>
2009-11-23 cgo translates empty function arguments into void instead of dying with ↵Eden Li1-0/+9
'unexpected type: ...'. Fixes issue 162. R=rsc http://codereview.appspot.com/157147 Committer: Russ Cox <rsc@golang.org>
2009-11-23go: makes it build for the case $GOROOT has whitespacesSergio Luis O. B. Correia1-2/+2
the bash scripts and makefiles for building go didn't take into account the fact $GOROOT / $GOBIN could both be directories containing whitespaces, and was not possible to build it in such a situation. this commit adjusts the various makefiles/scripts to make it aware of that possibility, and now it builds successfully when using a path with whitespaces as well. Fixes issue 115. R=rsc, dsymonds1 http://codereview.appspot.com/157067 Committer: Russ Cox <rsc@golang.org>
2009-11-20gofmt -r 'α[β:len(α)] -> α[β:]' -w src/cmd src/pkgRuss Cox2-3/+3
R=r, gri CC=golang-dev http://codereview.appspot.com/156115
2009-11-20cgo: allow .so in subdirectoriesRuss Cox1-1/+1
R=r http://codereview.appspot.com/157103
2009-11-19cgo now renders types with unknown size as [0]byte instead of raising aEden Li1-2/+5
fatal error. Fixes issue 126. R=rsc http://codereview.appspot.com/157101 Committer: Russ Cox <rsc@golang.org>
2009-11-19Permit omission of hi bound in slices.Robert Griesemer1-0/+3
R=r, rsc http://codereview.appspot.com/157082
2009-11-18remove bytes.CopyRob Pike1-2/+1
replace all calls with calls to copy use copy in regexp and bytes.Buffer R=rsc CC=golang-dev http://codereview.appspot.com/157073
2009-11-18Mangle C struct fields that happen to be named after Go keywords by ↵Eden Li1-1/+30
prefixing them with _. Collisions with existing fields are resolved by prefixing the new Go identifier with _ until it matches nothing else in the struct. Fixes issue 36. R=rsc http://codereview.appspot.com/157061 Committer: Russ Cox <rsc@golang.org>
2009-11-17cgo no longer translates function args that are void* intoEden Li1-1/+5
unsafe.Pointer. Fixes issue 254. R=rsc http://codereview.appspot.com/157060 Committer: Russ Cox <rsc@golang.org>
2009-11-15cgo: arrange for English error messagesRuss Cox1-0/+5
Fixes issue 21. R=r http://codereview.appspot.com/155048
2009-11-11cgo: add more information about gcc output parsing failuresRuss Cox1-0/+4
R=r http://codereview.appspot.com/152084
2009-11-09- replaced gofmt expression formatting algorithm withRobert Griesemer2-15/+15
rsc's algorithm - applied gofmt -w misc src - partial CL (remaining files in other CLs) R=rsc, r http://go/go-review/1024040