1
0
mirror of https://github.com/golang/go synced 2024-11-17 22:34:47 -07:00
go/misc/cgo/test/issue29383.go
Ian Lance Taylor 08477a38ab cmd/cgo: don't let inserted /*line*/ become a // comment
Fixes #29383

Change-Id: I0fb2929863e153b96d32d851e25e536231e4ae65
Reviewed-on: https://go-review.googlesource.com/c/155638
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2018-12-22 00:45:13 +00:00

20 lines
480 B
Go

// Copyright 2018 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.
// cgo's /*line*/ comments failed when inserted after '/',
// because the result looked like a "//" comment.
// No runtime test; just make sure it compiles.
package cgotest
// #include <stddef.h>
import "C"
func Issue29383(n, size uint) int {
if ^C.size_t(0)/C.size_t(n) < C.size_t(size) {
return 0
}
return 0
}