From aed94883cf01bcdec3e33a78fd4c70fe23cb5b47 Mon Sep 17 00:00:00 2001 From: mappu Date: Sun, 20 Oct 2024 19:04:18 +1300 Subject: [PATCH] genbindings: escape hyphens in generated header include guards --- cmd/genbindings/emitcabi.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/genbindings/emitcabi.go b/cmd/genbindings/emitcabi.go index d4f48956..36cd999f 100644 --- a/cmd/genbindings/emitcabi.go +++ b/cmd/genbindings/emitcabi.go @@ -507,7 +507,7 @@ func cabiClassName(className string) string { func emitBindingHeader(src *CppParsedHeader, filename string, packageName string) (string, error) { ret := strings.Builder{} - includeGuard := "GEN_" + strings.ToUpper(strings.Replace(filename, `.`, `_`, -1)) + includeGuard := "GEN_" + strings.ToUpper(strings.Replace(strings.Replace(filename, `.`, `_`, -1), `-`, `_`, -1)) bindingInclude := "../libmiqt/libmiqt.h"