diff --git a/cmd/codegen/gengo.go b/cmd/codegen/gengo.go index ccf08d0d..af28b9b8 100644 --- a/cmd/codegen/gengo.go +++ b/cmd/codegen/gengo.go @@ -74,11 +74,6 @@ func IsStructName(name CIdentifier, ctx *Context) bool { return ok } -func IsEnum(name CIdentifier, enums map[CIdentifier]bool) bool { - _, ok := enums[name] - return ok -} - func IsTemplateTypedef(s string) bool { return strings.Contains(s, "<") } diff --git a/cmd/codegen/gengo_typedefs.go b/cmd/codegen/gengo_typedefs.go index 883fc875..1a2928dc 100644 --- a/cmd/codegen/gengo_typedefs.go +++ b/cmd/codegen/gengo_typedefs.go @@ -76,7 +76,9 @@ func GenerateTypedefs( continue } - if IsEnum(k, ctx.enumNames) /*|| IsStructName(k, structs)*/ { + _, isEnum := ctx.enumNames[k] + _, isRefEnum := ctx.refEnumNames[k] + if isEnum || isRefEnum { if ctx.flags.showGenerated { glg.Infof("typedef %s has extended deffinition in structs_and_enums.json. Will generate later", k) } diff --git a/cmd/codegen/return_wrapper.go b/cmd/codegen/return_wrapper.go index 6d971e74..7652a183 100644 --- a/cmd/codegen/return_wrapper.go +++ b/cmd/codegen/return_wrapper.go @@ -84,7 +84,7 @@ func getReturnWrapper( _, isRefEnum := context.refEnumNames[pureType] _, shouldSkipRefTypedef := context.preset.SkipTypedefs[pureType] _, isStruct := context.typedefsNames[pureType] - isStruct = isStruct || ((isRefStruct || (isRefTypedef && !IsEnum(pureType, context.refEnumNames))) && !shouldSkipRefTypedef) + isStruct = isStruct || ((isRefStruct || (isRefTypedef && !isRefEnum)) && !shouldSkipRefTypedef) w, known := returnWrapperMap[t] // check if is array (match regex) isArray, err := regexp.Match(".*\\[\\d+\\]", []byte(t))