mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-08 04:53:42 +00:00
cgo: refactor; support multiple cgo files in a single package
This is a big commit that does a few things:
* It moves CGo processing into a separate package. It never really
belonged in the loader package, and certainly not now that the
loader package may be refactored into a driver package.
* It adds support for multiple CGo files (files that import package
"C") in a single package. Previously, this led to multiple
definition errors in the Go typecheck phase because certain C
symbols were defined multiple times in all the files. Now it
generates a new fake AST that defines these, to avoid multiple
definition errors.
* It improves debug info in a few edge cases that are probably not
relevant outside of bugs in cgo itself.
This commit is contained in:
committed by
Ron Evans
parent
4619207f99
commit
11567c62d4
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
package main
|
||||
|
||||
// Make sure CGo supports multiple files.
|
||||
|
||||
// int fortytwo(void);
|
||||
import "C"
|
||||
Reference in New Issue
Block a user