diff --git a/transpile/service.go b/transpile/service.go index c252a88..20bc8ab 100644 --- a/transpile/service.go +++ b/transpile/service.go @@ -441,6 +441,10 @@ func handleIdent(expr ast.Expr) string { switch ident.Name { case "nil": code += "NULL" + case "uint32": + code += "unsigned long" + case "uint64": + code += "unsigned long long" case "string": code += "char*" default: diff --git a/transpile/service_test.go b/transpile/service_test.go index e8fad3b..235a70d 100644 --- a/transpile/service_test.go +++ b/transpile/service_test.go @@ -904,6 +904,36 @@ var _ = Describe("Go Translator", func() { ` Compare(source, expected) }) + It("uint32 -> unsigned long", func() { + source := `package test + func Loop() { + var i uint32 + } + ` + expected := ` + void loop(); + + void loop() { + unsigned long i; + } + ` + Compare(source, expected) + }) + It("uint64 -> unsigned long long", func() { + source := `package test + func Loop() { + var i uint64 + } + ` + expected := ` + void loop(); + + void loop() { + unsigned long long i; + } + ` + Compare(source, expected) + }) It("i++", func() { source := `package test func Loop() {