genbindings: escape hyphens in generated header include guards

This commit is contained in:
mappu 2024-10-20 19:04:18 +13:00
parent 301fa27e83
commit aed94883cf

View File

@ -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"