Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 92f01c5

Browse files
committed
accept * in return value type and convert it to _ptr after the
typename, as in argument types. (Jack)
1 parent db9a7b9 commit 92f01c5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Tools/bgen/bgen/scantools.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def initpatterns(self):
228228
# self.type_pat = "pascal[ \t\n]+\(<type>[a-zA-Z0-9_ \t]*[a-zA-Z0-9_]\)[ \t\n]+"
229229
self.type_pat = "EXTERN_API" + \
230230
"[ \t\n]*([ \t\n]*" + \
231-
"\(<type>[a-zA-Z0-9_ \t]*[a-zA-Z0-9_]\)" + \
231+
"\(<type>[a-zA-Z0-9_* \t]*[a-zA-Z0-9_*]\)" + \
232232
"[ \t\n]*)[ \t\n]*"
233233
self.name_pat = "\(<name>[a-zA-Z0-9_]+\)[ \t\n]*"
234234
self.args_pat = "(\(<args>\([^(;=)]+\|([^(;=)]*)\)*\))"
@@ -399,6 +399,7 @@ def processrawspec(self, raw):
399399
self.report("Bad raw spec: %s", `raw`)
400400
return
401401
type, name, args = self.whole.group('type', 'name', 'args')
402+
type = regsub.gsub("\*", " ptr", type)
402403
type = regsub.gsub("[ \t]+", "_", type)
403404
if name in self.alreadydone:
404405
self.report("Name has already been defined: %s", `name`)

0 commit comments

Comments
 (0)