|
@@ -0,0 +1,34 @@
|
|
|
+diff --git a/lib/python/ctypes/ctypesgencore/ctypedescs.py b/lib/python/ctypes/ctypesgencore/ctypedescs.py
|
|
|
+index 1b061ea1f..b04fba80e 100644
|
|
|
+--- a/lib/python/ctypes/ctypesgencore/ctypedescs.py
|
|
|
++++ b/lib/python/ctypes/ctypesgencore/ctypedescs.py
|
|
|
+@@ -297,8 +297,16 @@ class CtypesFunction(CtypesType):
|
|
|
+ CtypesType.visit(self, visitor)
|
|
|
+
|
|
|
+ def py_string(self):
|
|
|
++ at = []
|
|
|
++ for a in self.argtypes:
|
|
|
++ if a.py_string() == "String":
|
|
|
++ at.append("POINTER(String)")
|
|
|
++ elif a.py_string()[:5] == "union":
|
|
|
++ at.append("POINTER(%s)" % a.py_string())
|
|
|
++ else:
|
|
|
++ at.append(a.py_string())
|
|
|
+ return 'CFUNCTYPE(UNCHECKED(%s), %s)' % (self.restype.py_string(),
|
|
|
+- ', '.join([a.py_string() for a in self.argtypes]))
|
|
|
++ ', '.join([a for a in at]))
|
|
|
+
|
|
|
+ last_tagnum = 0
|
|
|
+
|
|
|
+diff --git a/lib/python/ctypes/ctypesgencore/parser/ctypesparser.py b/lib/python/ctypes/ctypesgencore/parser/ctypesparser.py
|
|
|
+index b64d38c9c..0a840acff 100644
|
|
|
+--- a/lib/python/ctypes/ctypesgencore/parser/ctypesparser.py
|
|
|
++++ b/lib/python/ctypes/ctypesgencore/parser/ctypesparser.py
|
|
|
+@@ -183,7 +183,7 @@ class CtypesParser(CParser):
|
|
|
+ isinstance(t.destination, CtypesSimple) and
|
|
|
+ t.destination.name == "char" and
|
|
|
+ t.destination.signed):
|
|
|
+- t = CtypesSpecial("String")
|
|
|
++ t = CtypesSpecial("POINTER(String)")
|
|
|
+
|
|
|
+ return t
|