From b93ba4c01f7d4b4f9614853302aadbc93b4c863a Mon Sep 17 00:00:00 2001 From: Greg Date: Fri, 26 Apr 2019 14:15:18 -0400 Subject: [PATCH] Fix handling of signed, unsigned, complex, and long long types in Go type declarations. --- types/convert.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/types/convert.go b/types/convert.go index 8477b5c..4db8451 100644 --- a/types/convert.go +++ b/types/convert.go @@ -87,10 +87,11 @@ func swapstars(s string) string { func (t *Type) CGoType() string { ct := swapstars("C." + t.CType()) + ct = strings.ReplaceAll(ct,"unsigned ","u") + ct = strings.ReplaceAll(ct,"signed ","u") + ct = strings.ReplaceAll(ct,"long ","long") + ct = strings.ReplaceAll(ct,"complex ","complex") ct = strings.ReplaceAll(ct," ","_") - if ct == "C.long_long" { - ct = "C.long" // FIXME why? - } return ct }