Skip to content

Commit

Permalink
TestBindMacros
Browse files Browse the repository at this point in the history
  • Loading branch information
ddkwork committed Jun 21, 2024
1 parent 563c8fc commit 3184433
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 36 deletions.
13 changes: 0 additions & 13 deletions gengo/bind/sdk/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,7 @@ func TestMergeHeader(t *testing.T) {
for _, s := range Imports.Keys() {
fnDo(s)
}

stream.WriteBinaryFile("merged_headers.h", g.Buffer)

b := stream.NewBuffer("merged_headers.h")
lines := b.ToLines()
b.Reset()
for i := 0; i < len(lines); i++ {
if lines[i] == "typedef union" {
println(lines[i])
lines[i+2] = " struct VMX_SEGMENT_ACCESS_RIGHTS_TYPE"
}
b.WriteStringLn(lines[i])
}
stream.WriteBinaryFile("merged_headers.h", b.Buffer)
}

// ContainsLetter 检查字符串中是否包含字母
Expand Down
2 changes: 1 addition & 1 deletion gengo/bind/sdk/merged_headers.h
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@ typedef struct _EPT_SINGLE_HOOK_UNHOOKING_DETAILS
*/
typedef union
{
struct VMX_SEGMENT_ACCESS_RIGHTS_TYPE
struct
{
/**
* [Bits 3:0] Segment type.
Expand Down
38 changes: 19 additions & 19 deletions gengo/bind/sdk/tmp/HPRDBGCTRL.go

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

5 changes: 2 additions & 3 deletions gengo/gengo/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,8 @@ func (mod Module) EmitSyntheticStruct(n *clang.RecordDecl, layout *clang.RecordL
for _, c := range layout.Fields {
name := mod.Parent.NameField(c.Name, n.Name)
if name == "" {
name = "emptyFieldName"
mylog.Todo("dd accessors for each field name is empty")
mylog.Todo(c.Type)
name = "Fields"
mylog.Todo("test " + c.Type)
}
var funcDec dst.FuncDeclDecorations
for _, f := range n.Children() {
Expand Down

0 comments on commit 3184433

Please sign in to comment.