diff options
author | Colin Walters <walters@verbum.org> | 2010-05-18 15:27:49 -0400 |
---|---|---|
committer | Johan Dahlin <johan@gnome.org> | 2010-05-19 09:47:34 -0300 |
commit | 26ac70c37e4ea2f7e1caf8cebed3577695ce20e3 (patch) | |
tree | c0dbd198de09054c3918a14f510867e468b1c57e /giscanner | |
parent | e697a497e26e34099d081f64b0f58531b3c5c6d0 (diff) | |
download | gobject-introspection-26ac70c37e4ea2f7e1caf8cebed3577695ce20e3.tar.gz |
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
Diffstat (limited to 'giscanner')
-rw-r--r-- | giscanner/ast.py | 22 |
1 files changed, 19 insertions, 3 deletions
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 |