From 13f09c5594f19b9c5c3b0a86888b63da76c185d3 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Sun, 13 Feb 2022 14:33:10 +0000 Subject: [PATCH] Add GI_TYPE_TAG_IS_BASIC And deprecate G_TYPE_TAG_IS_BASIC. Let's avoid hijacking the G namespace any further. --- gitypeinfo.h | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/gitypeinfo.h b/gitypeinfo.h index a8674fd9b..39912ae7e 100644 --- a/gitypeinfo.h +++ b/gitypeinfo.h @@ -45,8 +45,40 @@ G_BEGIN_DECLS * @tag: a type tag * * Checks if @tag is a basic type. + * + * Deprecated: 1.72: Use GI_TYPE_TAG_IS_BASIC() instead */ -#define G_TYPE_TAG_IS_BASIC(tag) (tag < GI_TYPE_TAG_ARRAY || tag == GI_TYPE_TAG_UNICHAR) +#define G_TYPE_TAG_IS_BASIC(tag) GI_TYPE_TAG_IS_BASIC(tag) + +/** + * GI_TYPE_TAG_IS_BASIC + * @tag: a type tag + * + * Checks if @tag is a basic type. + * + * Since: 1.72 + */ +#define GI_TYPE_TAG_IS_BASIC(tag) ((tag) < GI_TYPE_TAG_ARRAY || (tag) == GI_TYPE_TAG_UNICHAR) + +/** + * GI_TYPE_TAG_IS_NUMERIC: + * @tag: a type tag + * + * Checks if @tag is a numeric type. That is, integer or floating point. + * + * Since: 1.72 + */ +#define GI_TYPE_TAG_IS_NUMERIC(tag) ((tag) >= GI_TYPE_TAG_INT8 && (tag) <= GI_TYPE_TAG_DOUBLE) + +/** + * GI_TYPE_TAG_IS_NUMERIC: + * @tag: a type tag + * + * Checks if @tag is a numeric type. That is, integer or floating point. + * + * Since: 1.72 + */ +#define GI_TYPE_TAG_IS_NUMERIC(tag) ((tag) >= GI_TYPE_TAG_INT8 && (tag) <= GI_TYPE_TAG_DOUBLE) /** * GI_TYPE_TAG_IS_NUMERIC: