mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/cgo: make the char * pointer in GoString const
This makes it more convenient for C code to use GoString with string constants. Since Go string values are immutable, the const qualifier is appropriate in C. Change-Id: I5fb3cdce2ce5079f1f0467a1544bb3a1eb27b811 Reviewed-on: https://go-review.googlesource.com/17067 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
4d6a69f227
commit
17360accab
4 changed files with 27 additions and 1 deletions
|
|
@ -1429,7 +1429,7 @@ typedef __complex double GoComplex128;
|
|||
*/
|
||||
typedef char _check_for_GOINTBITS_bit_pointer_matching_GoInt[sizeof(void*)==GOINTBITS/8 ? 1:-1];
|
||||
|
||||
typedef struct { char *p; GoInt n; } GoString;
|
||||
typedef struct { const char *p; GoInt n; } GoString;
|
||||
typedef void *GoMap;
|
||||
typedef void *GoChan;
|
||||
typedef struct { void *t; void *v; } GoInterface;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue