Add value annotation to G_TYPE_FUNDAMENTAL_MAX

The introspection parser isn't good enough to expand the shift symbol,
which means G_TYPE_FUNDAMENTAL_MAX is evaluated as (255 << 0).

We can use the `(value)` annotation to force the symbol value in the
introspection data.

See: GNOME/gobject-introspection#473
This commit is contained in:
Emmanuele Bassi
2023-09-27 11:48:26 +01:00
parent 7ed14113e7
commit 70585f9a48

View File

@@ -41,7 +41,13 @@ G_BEGIN_DECLS
*/ */
#define G_TYPE_FUNDAMENTAL(type) (g_type_fundamental (type)) #define G_TYPE_FUNDAMENTAL(type) (g_type_fundamental (type))
/** /**
* G_TYPE_FUNDAMENTAL_MAX: * G_TYPE_FUNDAMENTAL_SHIFT:
*
* Shift value used in converting numbers to type IDs.
*/
#define G_TYPE_FUNDAMENTAL_SHIFT (2)
/**
* G_TYPE_FUNDAMENTAL_MAX: (value 1020)
* *
* An integer constant that represents the number of identifiers reserved * An integer constant that represents the number of identifiers reserved
* for types that are assigned at compile-time. * for types that are assigned at compile-time.
@@ -207,12 +213,6 @@ G_BEGIN_DECLS
* Open an issue on https://gitlab.gnome.org/GNOME/glib/issues/new for * Open an issue on https://gitlab.gnome.org/GNOME/glib/issues/new for
* reservations. * reservations.
*/ */
/**
* G_TYPE_FUNDAMENTAL_SHIFT:
*
* Shift value used in converting numbers to type IDs.
*/
#define G_TYPE_FUNDAMENTAL_SHIFT (2)
/** /**
* G_TYPE_MAKE_FUNDAMENTAL: * G_TYPE_MAKE_FUNDAMENTAL:
* @x: the fundamental type number. * @x: the fundamental type number.