Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/cgo: recognize untyped constants defined in different files
An untyped constant can be defined in any input file, we shouldn't segregate them by file. Updates #28772 Change-Id: I0347f15236833bb511eb49f86c449ee9241b0a25 Reviewed-on: https://go-review.googlesource.com/c/151600 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Andrew Bonventre <andybons@golang.org>
- Loading branch information
1 parent
048580d
commit 4f26f24
Showing
5 changed files
with
18 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// 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. | ||
|
||
package cgotest | ||
|
||
// Constants didn't work if defined in different source file. | ||
|
||
// #define issue28772Constant2 2 | ||
import "C" | ||
|
||
const issue28772Constant2 = C.issue28772Constant2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters