From: Colin Walters Date: Tue, 18 May 2010 19:27:49 +0000 (-0400) Subject: Add uid_t, gid_t, dev_t to integral type conversions X-Git-Tag: GOBJECT_INTROSPECTION_0_6_11~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=26ac70c37e4ea2f7e1caf8cebed3577695ce20e3;p=platform%2Fupstream%2Fgobject-introspection.git Add uid_t, gid_t, dev_t to integral type conversions Continuing where we were going with pid_t, define a few more POSIX types by converting them to their fundamental integers. See commentary in patch for more explanation on rationale. https://bugzilla.gnome.org/show_bug.cgi?id=618778 --- diff --git a/giscanner/ast.py b/giscanner/ast.py index 1265883a..ef476eb9 100644 --- a/giscanner/ast.py +++ b/giscanner/ast.py @@ -115,11 +115,27 @@ type_names['char*'] = TYPE_STRING type_names['void*'] = TYPE_ANY type_names['void'] = TYPE_NONE -# C unix types -type_names['off_t'] = TYPE_SIZET -type_names['pid_t'] = TYPE_INT +# Unix types that we special case here (and that have their own introspection +# type tag) because of wide use in GLib. type_names['size_t'] = TYPE_SIZET type_names['ssize_t'] = TYPE_SSIZET + +# One off C unix type definitions; note some of these may be GNU Libc +# specific. If someone is actually bitten by this, feel free to do +# the required configure goop to determine their size and replace +# here. +# +# We don't want to encourage people to use these in their APIs because +# they compromise the platform-independence that GLib gives you. +# These are here mostly to avoid blowing when random platform-specific +# methods are added under #ifdefs inside GLib itself. We could just (skip) +# the relevant methods, but on the other hand, since these types are just +# integers it's easy enough to expand them. +type_names['off_t'] = TYPE_SIZET +type_names['pid_t'] = TYPE_INT +type_names['uid_t'] = TYPE_UINT +type_names['gid_t'] = TYPE_UINT +type_names['dev_t'] = TYPE_INT type_names['socklen_t'] = TYPE_INT32 # Obj-C