diff --git a/cmd/genbindings/emitcabi.go b/cmd/genbindings/emitcabi.go index d4e9e8c4..7bbbfc32 100644 --- a/cmd/genbindings/emitcabi.go +++ b/cmd/genbindings/emitcabi.go @@ -609,7 +609,7 @@ func cabiPreventStructDeclaration(className string) bool { func emitBindingHeader(src *CppParsedHeader, filename string, packageName string) (string, error) { ret := strings.Builder{} - includeGuard := "GEN_" + strings.ToUpper(strings.Replace(strings.Replace(filename, `.`, `_`, -1), `-`, `_`, -1)) + includeGuard := "MIQT_" + strings.ToUpper(strings.Replace(strings.Replace(packageName, `/`, `_`, -1), `-`, `_`, -1)) + "_GEN_" + strings.ToUpper(strings.Replace(strings.Replace(filename, `.`, `_`, -1), `-`, `_`, -1)) bindingInclude := "../libmiqt/libmiqt.h" @@ -617,7 +617,8 @@ func emitBindingHeader(src *CppParsedHeader, filename string, packageName string bindingInclude = "../" + bindingInclude } - ret.WriteString(`#ifndef ` + includeGuard + ` + ret.WriteString(`#pragma once +#ifndef ` + includeGuard + ` #define ` + includeGuard + ` #include diff --git a/libmiqt/libmiqt.h b/libmiqt/libmiqt.h index 8b6ddbc1..3b7b6767 100644 --- a/libmiqt/libmiqt.h +++ b/libmiqt/libmiqt.h @@ -1,5 +1,6 @@ -#ifndef MIQT_BINDING_H -#define MIQT_BINDING_H +#pragma once +#ifndef MIQT_LIBMIQT_LIBMIQT_H +#define MIQT_LIBMIQT_LIBMIQT_H #include #include