summaryrefslogtreecommitdiff
path: root/libgo/go/runtime/print.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/runtime/print.go')
-rw-r--r--libgo/go/runtime/print.go28
1 files changed, 22 insertions, 6 deletions
diff --git a/libgo/go/runtime/print.go b/libgo/go/runtime/print.go
index 97d595fb2fb..371cec50587 100644
--- a/libgo/go/runtime/print.go
+++ b/libgo/go/runtime/print.go
@@ -2,12 +2,32 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build ignore
-
package runtime
import "unsafe"
+// For gccgo, use go:linkname to rename compiler-called functions to
+// themselves, so that the compiler will export them.
+//
+//go:linkname printbool runtime.printbool
+//go:linkname printfloat runtime.printfloat
+//go:linkname printint runtime.printint
+//go:linkname printhex runtime.printhex
+//go:linkname printuint runtime.printuint
+//go:linkname printcomplex runtime.printcomplex
+//go:linkname printstring runtime.printstring
+//go:linkname printpointer runtime.printpointer
+//go:linkname printiface runtime.printiface
+//go:linkname printeface runtime.printeface
+//go:linkname printslice runtime.printslice
+//go:linkname printnl runtime.printnl
+//go:linkname printsp runtime.printsp
+//go:linkname printlock runtime.printlock
+//go:linkname printunlock runtime.printunlock
+// Temporary for C code to call:
+//go:linkname gwrite runtime.gwrite
+//go:linkname printhex runtime.printhex
+
// The compiler knows that a print of a value of this type
// should use printhex instead of printuint (decimal).
type hex uint64
@@ -201,10 +221,6 @@ func printpointer(p unsafe.Pointer) {
}
func printstring(s string) {
- if uintptr(len(s)) > maxstring {
- gwrite(bytes("[string too long]"))
- return
- }
gwrite(bytes(s))
}