From f35be1268c996d993ab0b4ff329734d467474445 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 21 Sep 2022 16:26:08 -0700 Subject: cmd/cgo: add and use runtime/cgo.Incomplete instead of //go:notinheap This ports https://go.dev/cl/421879 to libgo. This is a quick port to update gofrontend to work with the version of cgo in gc mainline. A more complete port will follow, changing the gc version of cmd/cgo to choose an approach based on feature testing the gccgo in use. Updates golang/go#46731 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/432338 --- libgo/go/runtime/cgo/cgo.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 libgo/go/runtime/cgo/cgo.go (limited to 'libgo/go/runtime/cgo') diff --git a/libgo/go/runtime/cgo/cgo.go b/libgo/go/runtime/cgo/cgo.go new file mode 100644 index 0000000..5921435 --- /dev/null +++ b/libgo/go/runtime/cgo/cgo.go @@ -0,0 +1,18 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +Package cgo contains runtime support for code generated +by the cgo tool. See the documentation for the cgo command +for details on using cgo. +*/ +package cgo + +// Incomplete is used specifically for the semantics of incomplete C types. +// +//go:notinheap +type Incomplete struct { + // _ sys.NotInHeap + _ struct{ _ struct{} } +} -- cgit v1.1