Add G_TYPE_(U)SHORT types
While GLib has GTypes defined for the other fundamental integral types, it is currently missing types for gshort
and gushort
, and as such it is not possible to refer to shorts using the GType system.
As a result, type systems based on GType can't represent shorts either, so it's not possible to e.g. determine the difference between a int
and a short
at runtime in vala (vala#993), which is useful in e.g. generic functions that use different code paths depending on the type parameter.
Since GLib includes gshort
and gushort
typedefs, as well as other machinery such as G_MAXUSHORT
, and GVariant has support for (U)INT16
types, there's some precedent for proper support for shorts in the library. Adding the missing GTypes would fix their omission.
I'll happily look at implementing this if there is interest in taking a patch for it.