Skip to content

Commit 65cd8e1

Browse files
committed
don't hardcode zdl.go
1 parent 68b2548 commit 65cd8e1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cmd/mkcgo/generate.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,6 @@ func generateNocgoGo(src *mkcgo.Source, w io.Writer) {
700700
// Output header notice and package declaration.
701701
printHeader(w)
702702

703-
// Set build tag based on whether this is a zdl file
704703
tags := "!cgo"
705704
if *extratags != "" {
706705
tags += " && (" + *extratags + ")"
@@ -1073,7 +1072,11 @@ func generateNocgoFnBody(src *mkcgo.Source, fn *mkcgo.Func, newR0 bool, w io.Wri
10731072
// This function is only called when dynamic imports are used.
10741073
func generateAssembly(src *mkcgo.Source, w io.Writer) {
10751074
printHeader(w)
1076-
fmt.Fprintf(w, "//go:build !cgo\n\n")
1075+
tags := "!cgo"
1076+
if *extratags != "" {
1077+
tags += " && (" + *extratags + ")"
1078+
}
1079+
fmt.Fprintf(w, "//go:build %s\n\n", tags)
10771080
fmt.Fprintf(w, "#include \"textflag.h\"\n \n")
10781081

10791082
// Generate trampolines for each function

0 commit comments

Comments
 (0)