We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a40bf94 + be6035a commit 49f59aaCopy full SHA for 49f59aa
cl/internal/convert/convert.go
@@ -106,7 +106,7 @@ func (p *Converter) Process() {
106
}
107
log.Panicln("ConvMacro:", err)
108
109
- ctx.p.SetCurFile(goFile, true)
+ ctx.SetGoFile(goFile)
110
ctx.NewMacro(goName, macro)
111
112
cl/internal/convert/package.go
@@ -166,6 +166,13 @@ func (p *Package) SetCurFile(hfile *HeaderFile) {
166
167
*/
168
169
+// to keep the unsafe package load to use go:linkname command
170
+func (p *Package) SetGoFile(goFile string) {
171
+ p.p.SetCurFile(goFile, true)
172
+ // todo(zzy):avoid remark
173
+ p.p.Unsafe().MarkForceUsed(p.p)
174
+}
175
+
176
// todo(zzy):refine logic
177
func (p *Package) linkLib(lib string) error {
178
if lib == "" {
0 commit comments