diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2021-03-07 17:52:38 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2021-03-07 17:52:38 (GMT) |
commit | 7a60504691ebd8b914592e60990cc3526cf26e29 (patch) | |
tree | 8093ae850e6dc720296c71deee3c3eb0a5763ed1 /src/analysis/type-int.h | |
parent | a79d209385fca4e74a6a85b2386be71ec23057bb (diff) |
Compact data type definitions.
Diffstat (limited to 'src/analysis/type-int.h')
-rw-r--r-- | src/analysis/type-int.h | 50 |
1 files changed, 47 insertions, 3 deletions
diff --git a/src/analysis/type-int.h b/src/analysis/type-int.h index e14d209..d6c2588 100644 --- a/src/analysis/type-int.h +++ b/src/analysis/type-int.h @@ -29,6 +29,7 @@ #include "storage/serialize-int.h" +#include "../glibext/objhole.h" @@ -58,18 +59,61 @@ typedef bool (* type_is_reference_fc) (const GDataType *); +/* Informations glissées dans la structure GObject de GBinSymbol */ +typedef union _type_obj_extra +{ + struct + { + TypeQualifier qualifiers; /* Eventuels qualificatifs */ + char ns_sep[2]; /* Séparateur d'éléments */ + TypeFlag flags; /* Propriétés du type */ + + }; + + gint lock; /* Gestion d'accès aux fanions */ + +} type_obj_extra; + /* Description de type quelconque (instance) */ struct _GDataType { GObject parent; /* A laisser en premier */ - TypeQualifier qualifiers; /* Eventuels qualificatifs */ - GDataType *namespace; /* Espace de noms / classe */ - char *ns_sep; /* Séparateur d'éléments */ + +#if __SIZEOF_INT__ == __SIZEOF_LONG__ + + /** + * L'inclusion des informations suivantes dépend de l'architecture. + * + * Si la structure GObject possède un trou, on remplit de préférence + * ce dernier. + */ + + type_obj_extra extra; /* Externalisation embarquée */ + +#endif }; +/** + * Accès aux informations éventuellement déportées. + */ + +#if __SIZEOF_INT__ == __SIZEOF_LONG__ + +# define INIT_DATA_TYPE_EXTRA(tp) tp->extra.lock = 0 + +# define GET_DATA_TYPE_EXTRA(tp) &tp->extra + +#else + +# define INIT_DATA_TYPE_EXTRA(tp) INIT_GOBJECT_EXTRA(G_OBJECT(tp)) + +# define GET_DATA_TYPE_EXTRA(tp) GET_GOBJECT_EXTRA(G_OBJECT(tp), type_obj_extra) + +#endif + /* Description de type quelconque (classe) */ struct _GDataTypeClass { |