Skip to content

Commit

Permalink
Merge pull request #383 from gucio321/add-empty-type-createors
Browse files Browse the repository at this point in the history
codegen: add NewEmptyXXX
  • Loading branch information
gucio321 authored Nov 10, 2024
2 parents 4000228 + 73be5c1 commit 72c467a
Show file tree
Hide file tree
Showing 7 changed files with 765 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ImGuiColorTextEdit/cimcte_typedefs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions cmd/codegen/gengo_typedefs.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,11 @@ func (self %[1]s) C() (C.%[2]s, func()) {
result, fn := self.Handle()
return *result, fn
}
// NewEmpty%[1]s creates %[1]s with its 0 value.
func New%[1]sEmpty() *%[1]s {
return &%[1]s{CData: new(C.%[2]s)}
}
`, name.renameGoIdentifier(g.ctx), name)
}

Expand Down
Loading

0 comments on commit 72c467a

Please sign in to comment.